Automate minor release preparation via bump-minor-logstash.yml#19461
Conversation
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
|
@copilot review comments |
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
|
@copilot review comments and apply https://docs.github.com/en/actions/reference/security/secure-use |
…puts Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
|
This pull request does not have a backport label. Could you fix it @copilot? 🙏
|
|
@copilot review comments and apply |
There was a problem hiding this comment.
Pull request overview
Adds automation for minor-release preparation by introducing a dedicated GitHub Actions workflow and wiring it into the Buildkite version bump pipeline, aiming to reduce manual steps in the minor release checklist.
Changes:
- Added a new
bump-minor-logstash.ymlworkflow to open PRs for dependency pin review, create a release branch, and bumpversions.ymlonmain. - Updated
.buildkite/version_bump_pipeline.ymlto add a “minor” workflow group that triggers the new workflow (and an additional workflow for dependency updates).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/bump-minor-logstash.yml |
New workflow to automate PR-opening steps for minor-release preparation (branch cut + versions.yml updates + dependency pin review reminder). |
.buildkite/version_bump_pipeline.yml |
Adds Buildkite steps for WORKFLOW == "minor" to dispatch GitHub workflows for branch/version prep and dependency updates. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot review comments |
…ove if on bump-versions-main, fix workflow-file Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
Suppressed comments (1)
.github/workflows/bump-minor-logstash.yml:154
bump-versions-mainis labeled as an "After feature freeze" step, but it currently runs on every dispatch (including the Buildkite-triggered pre-freeze run), which would open the release-track PR too early. Gate this job behind an explicit workflow input so it only runs when intentionally requested.
# "After feature freeze" - update logstash-release-track on main to point at the new minor branch.
bump-versions-main:
needs: [bump-versions-yml-main]
permissions:
| skip-branch-creation: | ||
| description: 'Skip creating the new release branch (use when logstash-branch is the last minor version of a major).' | ||
| required: false | ||
| type: boolean | ||
| default: false |
| - elastic/gh-cli#v0.1.1: | ||
| version: "2.88.1" | ||
| wait: true | ||
| workflow-file: "version_bumps.yml" | ||
| workflow-ref: "main" | ||
| workflow-inputs: |
There was a problem hiding this comment.
For now we run minor release from main, so we can keep the ref as main
Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
.github/workflows/bump-minor-logstash.yml:62
- The pin-detection logic only treats pins as “documented” when the same line contains a
#comment. In this repo, the existing exact pin inGemfile.template(rubocop-ast) is documented on the preceding line, so this workflow will incorrectly flag it and always open a reminder PR.
while IFS= read -r line; do
echo "Candidate pin in $f: $line"
CHANGED=1
done < <(grep -nE "['\"]= [0-9]" "$f" | grep -v "#" || true)
done
.github/workflows/bump-minor-logstash.yml:109
- PR description lists a post-freeze job (
bump-versions-yml-main-after-freeze/bump-versions-main) that updatesversions.ymlonmainafter feature freeze, but the workflow currently stops after opening the pre-freeze PR and does not include any post-freeze job. Either implement the post-freeze step (likely updatinglogstash-release-track/ related fields inversions.yml) or adjust the PR description/scope accordingly.
# "Before feature freeze" - update versions.yml on main to the next minor.
bump-versions-yml-main:
needs: [create-release-branch]
if: always() && (needs.create-release-branch.result == 'success' || needs.create-release-branch.result == 'skipped')
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
.github/workflows/bump-minor-logstash.yml:99
- PR description says
create-release-branchalso cuts the new release branch onelastic/logstash-docswhen a token is configured, but this workflow only pushes the branch to the current repo (origin). Either add the docs-repo branch creation logic (with appropriate token/secrets) or update the PR description so expectations match behavior.
# "Before feature freeze" - create the new release branch on elastic/logstash
create-release-branch:
if: ${{ inputs.skip-branch-creation != true }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: main
fetch-depth: 0
- name: Create release branch on elastic/logstash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOGSTASH_BRANCH: ${{ inputs.logstash-branch }}
run: |
if git ls-remote --exit-code --heads origin "${LOGSTASH_BRANCH}" > /dev/null 2>&1; then
echo "Branch ${LOGSTASH_BRANCH} already exists, skipping creation."
else
git push origin "HEAD:refs/heads/${LOGSTASH_BRANCH}"
fi
|
At a high level, what would be the timing/automation for this? IE where do the manual steps happen (on feature freeze day do we manually branch etc?). Who or what triggers this pipeline and what are the expectations etc around where it fits in the release process. Especially given the time between FF and GA for minors. Also, when generating the new lockfile, we may be changing how that works. Instead of doing any bundler commands locally we will do two PRs https://github.com/elastic/ingest-dev/pull/8711 one to copy the old lock and another to use the dependency bump action to update it (at minor level). |
The Platform Productivity Team has asked teams to automate the feature freeze, see #18765, that's the scaffolding they created fo help teams to start with. They are waiting for this project to automate the steps for minor releases during the feature freeze. Patch releases were already automated as part of #19280 I'd say their automation is blocked by this request. Let me ping @ninalee12 to provide further details if needed.
The Platform Productivity team is responsible to orchestrate the Feature Freeze, and they use some BK pipelines that will trigger the feature freeze for each project subscribed to the Unified Release. Bear in mind, I raised this request to help the team to move forward as part of the discussion we had last month, #19280 (comment). This implementation can be changed as needed, I'm not familiar with the logstash process just went through the existing docs and asked Copilot to implement the pieces I thought they were required. If the team prefer a different approach, that's totally fine, the important piece is to contribute to https://github.com/elastic/logstash/blob/main/.buildkite/version_bump_pipeline.yml to support minor releases. Happy to discuss further in a zoom call if needed. Thanks |
|
Hello all I can provide some insights on the current flow.
Regarding the timing and automation for the These are the environment variables passed to your pipeline that you can use to cut a new branch and bump Example from the recent In terms of the expectations, we'd expect that teams are cutting a new branch for the minor and bumping Hope this helps! |
|
Thanks both, that is helpful. So from my understanding: manual: at FF day (when the automation runs) we manually create a new minor branch (importantly this will be from main and wont have a gemfile.lock checked in. Main will also get a version bump as needed to avoid any conflicts. What this workflow will do:
|
This workflow will also create a release branch as part of the job called Bear in mind, creating PRs does not necessarily mean they have to be merged immediately after they have been built successfully but only when required. Probably we should add some explicit details in the description to help with the merge/review process. That's what we did in some other repositories. This workflow (including BK and GH actions) tried to implement what it was stated at https://github.com/elastic/ingest-dev/blob/main/.github/ISSUE_TEMPLATE/logstash-release-checklist-minor.md, for such, I raised #19460 and I included only the bits and pieces I thought they were needed. We can remove what's not needed and keep only what's needed. This workflow is aimed to help with the automation and can be split in batches if needed. Although, if it helps it might be beneficial if the logstash team takes the ownership since they are pretty familiar with the steps done for the Feature Freeze process. |
|
Oh, cool yeah if we can automate the branch creation thats great. IMO here is how it should work:
once we finalize this maybe we can have copilot update the existing PR with these spec? |
I'm biased here, but I tend to think the Meta BK pipeline orchestrator managed by the Release Team should be responsible for creating the release branch for a new minor. Why? Because creating the branch is a dependency, and the orchestrator is in the best position to know how many repositories are part of the Unified Release. It also keeps the implementation simpler. Otherwise, we'd need a specific GitHub ephemeral token for cross-project collaboration, plus some additional bits and pieces. For that reason, I think it would be clearer to stick with the existing contract: one BK pipeline in each GitHub repository contributing to the Unified Release, with the Meta BK pipeline orchestrating the overall process. That said, happy to discuss — I'm open to other perspectives.
@donoghuc, if you or someone from your team has the bandwidth to work on this task, I think it could help us move much faster. I'm not very familiar with the Logstash release process, so I don't have enough context on some of the specifics, where they're documented, or the caveats involved. Since your team already has the experience with how releases are done, what parts are automated versus manual, and where the relevant documentation lives, I think you'd be in a much better position to drive the implementation. My intention is mostly to avoid adding unnecessary back-and-forth or having someone unfamiliar with the process spend time rediscovering things the team already knows. I also think having the people who operate and maintain the release process involved in the implementation will help us get to the right solution more quickly. Of course, I'm happy to help wherever I can and will be glad to review the implementation, as always. |
Following the patch-release automation in #19280, minor releases had no equivalent: the checklist steps up to "Week before release" (branch creation, versions.yml bumps, lock file generation) were still done manually.
Changes
New workflow
.github/workflows/bump-minor-logstash.yml—workflow_dispatchtriggered bylogstash-versionandlogstash-branchinputs (plus optionalnext-minor-versionandskip-branch-creation), with jobs mapping to the minor release checklist:check-and-unpin-dependencies: flags undocumented exact-version pins inGemfile.template/logstash-core.gemspecand opens a PR againstmainfor review.create-release-branch: cuts the new release branch onelastic/logstash(andelastic/logstash-docswhen a token is configured), skippable for the last minor of a major.bump-versions-yml-main: opens a PR bumpingversions.ymlonmainto the next minor.bump-versions-yml-main-after-freeze: opens a PR updating the release track onmainpost-freeze..buildkite/version_bump_pipeline.yml— added a "Bump version minor" step, mirroring the existing patch step, that triggersbump-minor-logstash.ymlwhenWORKFLOW == "minor".All steps only open pull requests; purely manual steps (QA, doc coordination, DRA monitoring, Slack notifications) remain untouched.
bump-minor-logstash.ymlGitHub Action #19460