-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(cli): sort bundle output files for deterministic task-to-file attribution #4504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "trigger.dev": patch | ||
| --- | ||
|
|
||
| Fix non-deterministic task-to-file attribution when multiple tasks share an output bundle. `Object.entries` iteration order is not guaranteed, so tasks defined in imported files could be attributed to the wrong source file. Files are now sorted by entry path before registration. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -307,6 +307,8 @@ export async function getBundleResultFromBuild( | |
| } | ||
| } | ||
|
|
||
| files.sort((a, b) => a.entry.localeCompare(b.entry)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Alphabetical sort makes attribution deterministic but not necessarily correct Sorting Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| if (!configPath) { | ||
| return undefined; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Release note text describes internals instead of user impact
The release note for this change is written in implementation terms, naming internal mechanics (
Object.entriesin.changeset/bundle-deterministic-file-order.md:5) instead of a plain user-facing sentence, so shipped release notes will violate the repository's changeset writing rules.Impact: Users reading the release notes see internal jargon rather than a clear description of what changed for them.
Rule from AGENTS.md on changeset wording
AGENTS.md states: "Write the description for users, not maintainers. Both changesets and
.server-changes/notes ship verbatim in user-visible release notes. Lead with what changed for the user - one plain sentence describing behavior, not implementation, and never naming internal tools or infra." The current note leads with "non-deterministic task-to-file attribution" and citesObject.entriesiteration order and internal registration order.Was this helpful? React with 👍 or 👎 to provide feedback.