Skip to content

feat: add GitHub Action for source maps upload - #253

Merged
unjica merged 24 commits into
Telemetry-Tracker:developfrom
FelineFantasy:main
Jul 9, 2026
Merged

unjica merged 24 commits into
Telemetry-Tracker:developfrom
FelineFantasy:main

Conversation

@FelineFantasy

Copy link
Copy Markdown
Contributor

Summary

Added a composite GitHub Action to automate the upload of source map artifacts to the Telemetry-Tracker API upon a new release. Also updated the documentation with a workflow example.

Closes #98

How to test

Review the action.yml file structure and check the updated usage example at the bottom of docs/source-maps.md.

Checklist

  • Documentation updated (if needed)
  • New code follows the existing style
  • No breaking changes (or called out clearly above)

Security / privacy

N/A. Uses the provided project API key via action inputs.

@FelineFantasy
FelineFantasy requested a review from unjica as a code owner July 7, 2026 19:42

@unjica unjica left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @FelineFantasy — thanks for taking this on! I really like that you included both the composite action and the documentation example—that’s exactly the kind of developer experience I’d like Telemetry Tracker to have.

There are a few things that need to line up with the current API and GitHub Actions conventions before I can merge this.

Action setup

Composite actions should live under .github/actions/upload-source-maps/action.yml, not .github/action.yml.

The docs example should also point to that action path (or a published ref such as @main or a version tag) instead of using uses: ./.

Upload API

The current POST /api/project/source-maps endpoint expects a JSON payload (app, release, bundle_url, content) together with a dashboard session and X-Project-Id.

It doesn’t currently support multipart uploads or X-API-Key authentication, so the current implementation wouldn’t work against the production API.

The API host should also be:

https://api.telemetry-tracker.com

instead of:

https://telemetry-tracker.com

bundle_url

bundle_url is required to associate each source map with its JavaScript bundle for symbolication, but the action doesn’t send it yet.

A couple of smaller improvements

  • artifact_path/*.map only matches top-level files. Using find recursively would also pick up nested build outputs such as dist/assets/*.map.
  • Adding --fail-with-body to curl would ensure failed uploads correctly fail the workflow.

Next step

This feature depends on having a CI-friendly upload endpoint first. Once that’s available, this action can be updated to use it. Until then, it should match the current API contract.

Also, when you push updates, please retarget the PR to develop.

The idea itself is solid—it just needs to match the current implementation before I can merge it.

Push an update when you’re ready and I’ll happily take another look. I’d love to get this feature in. 🚀

@FelineFantasy
FelineFantasy changed the base branch from main to develop July 7, 2026 20:56
@FelineFantasy

Copy link
Copy Markdown
Contributor Author

@unjica Done! I've successfully retargeted the Pull Request to the develop branch and applied all the requested changes to the Action and documentation. Ready for another look! 🚀

@unjica

unjica commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Hey @FelineFantasy — thanks for the update!

This is looking much better. The action is in the right place now, it's using the correct API, and I like the recursive file discovery and error handling. Nice improvements overall.

I only spotted two things before I can merge this.

bundle_url for nested files

Right now bundle_url is built from just the filename. That works for top-level files, but something like:

dist/assets/app.js.map

ends up pointing to:

https://example.com/app.js

instead of:

https://example.com/assets/app.js

Since symbolication matches against the full bundle URL, nested builds won't resolve correctly.

I'd derive the path relative to artifact_path and append that to base_url.

Docs example

The workflow example currently has escaped expressions like:

\${{ secrets.TT_SESSION_COOKIE }}

If someone copies that into their workflow, GitHub Actions won't evaluate it correctly. Those should just be:

${{ secrets.TT_SESSION_COOKIE }}

One small suggestion while you're here: the API also accepts Authorization: Bearer <session-uuid>, which is a little cleaner than sending the raw cookie header. Totally optional for this PR, but it might be worth switching to (or at least mentioning that sessions expire until there's a dedicated CI upload endpoint).

Other than that, I think this is in good shape. Fix those last two things, push another update, and I think we're good to go.

Thanks again for sticking with it! 🚀

@FelineFantasy

Copy link
Copy Markdown
Contributor Author

Hey @unjica!

Thanks for the review! I've pushed the updates:

· Fixed bundle_url to preserve nested paths (e.g., assets/app.js.map → assets/app.js)
· Removed escaping in the documentation example

Should be good to go now. Ready for another look! 🚀

@unjica

unjica commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Hey @FelineFantasy — thanks for the follow-up!

This is looking really good. The docs expressions are fixed, and I like that you tackled the bundle_url issue. The relative-path approach is definitely the right direction.

There's just one small thing left before I can merge this.

bundle_url path

The current implementation still relies on string.replace(), which breaks when artifact_path is the default ./dist.

For example, findFiles() returns paths like:

dist/assets/app.js.map

but the replacement looks for:

./dist

Since those don't match, the generated URL ends up as:

https://example.com/dist/assets/app.js

instead of:

https://example.com/assets/app.js

I'd recommend using:

path.relative(path.resolve(artifactPath), path.resolve(filePath))

That should handle both dist and ./dist correctly without relying on string replacement.

One optional cleanup

While you're here, the comments in the action are still in Russian. It'd be great to switch those to English so they match the rest of the repository.

Other than that, I think this is in really good shape. Fix that last path issue, push another update, and I think this will be ready to merge.

Thanks again for sticking with it! 🚀

@FelineFantasy

Copy link
Copy Markdown
Contributor Author

Hey @unjica!

Thanks for the review! I've pushed the final fixes:

  1. Replaced string.replace with path.relative for bundle_url — now it correctly handles paths like ./dist/assets/app.js.map -> assets/app.js
  2. Translated all Russian comments to English

I split these into two separate commits for clarity.

This should be ready to go now. Let me know if there's anything else! 🚀

@unjica unjica left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sticking with this and addressing all the feedback!

Everything looks good to me now. There are still a few follow-up improvements I'd like to make around CI authentication and self-hosted support, but those can come in future PRs.

Nice work, and thanks again for the contribution! 🚀

@unjica

unjica commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

bugbot run

@unjica

unjica commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

@cursor review

@unjica
unjica merged commit a1b12f2 into Telemetry-Tracker:develop Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source maps: upload and symbolicated stack traces

2 participants