Migrate label-based releases to release pipelines#4
Open
bhendery wants to merge 2 commits intolinear:mainfrom
Open
Migrate label-based releases to release pipelines#4bhendery wants to merge 2 commits intolinear:mainfrom
bhendery wants to merge 2 commits intolinear:mainfrom
Conversation
adding readme for the script to the branch on the forked linear-solutions repo
adds actual script to my branch in the forked repo, intended to help customers who want to migrate from parent "releases" and sublabels 1.0, 1.1, 1.2 to release pipelines with releases 1.0, 1.1, 1.2
Author
|
cc @RomainCscn, @blkinney. I don't have permission in the upstream repo to assign reviewers, but letting you know this is here! |
RomainCscn
reviewed
Feb 19, 2026
| PARENT_LABEL_ID = "" | ||
| RELEASE_PIPELINE_ID = "" | ||
| RELEASE_STAGE_ID = "" | ||
| # For continuous pipelines, this is optional; we'll fallback to completed if you do not fill this field. |
There was a problem hiding this comment.
Let's say instead that this is supported only for scheduled. We don't allow custom stages for continuous.
RomainCscn
reviewed
Feb 19, 2026
| RELEASE_PIPELINE_ID = "" | ||
| RELEASE_STAGE_ID = "" | ||
| # For continuous pipelines, this is optional; we'll fallback to completed if you do not fill this field. | ||
| # If your pipeline is scheduled, set this field to the desired value. See README for how to find stage IDs. |
There was a problem hiding this comment.
Also usually, comments are above the variable they are mentioning.
RomainCscn
reviewed
Feb 19, 2026
RomainCscn
left a comment
There was a problem hiding this comment.
- README says the script is idempotent, but
issueToReleaseCreatefails if the issue is already linked to the release. Re-running after a partial run can error. Catch/ignorealready existsfor that mutation. - We intend people to use this with API key only, right? No pipeline access key support?
- We currently reuse a release if name OR version matches. That can pick the wrong release when names collide. Since pipeline uniqueness is on version, we should match by version first (and only fall back to name if version is empty)
- Don't think we use
LABEL_GROUP_IDin the code? - Maybe some reliability improvements: today one failed issue association currently stops the whole migration. For large backfills, we should collect per-issue errors, continue processing, and print a final failure summary.
- Related to this, might be useful to print some metrics at the end: labels processed, releases created/reused, issues linked, issues skipped/errors. Makes dry-run and audit much easier.
Collaborator
|
Agree with Romain on the retry/failure safeguards. I'd also call out that we might need rate limiting protections on this as well. |
blkinney
reviewed
Feb 19, 2026
|
|
||
| release_stage_id: Optional[str] = (args.stage_id or "").strip() or None | ||
|
|
||
| if not api_key.startswith(("lin_api_", "Bearer ")): |
Collaborator
There was a problem hiding this comment.
I may be missing something, but I don't think this would ever evaluate in a way that would apply the logic below?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These files are intended to address the use-case in LIN-58611 -- an org that has pre-existing "release" label groups, with sub labels for each individual release. This was a popular way to model releases in linear prior to the dedicated feature. The script takes a user's API key and UUIDs for the release pipeline, the label group, and optionally stage.