Repository navigation
GHA: create weekly patch workflow - #9751
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe new workflow runs weekly or manually. It authenticates with a GitHub App, finds the latest release branch and patch tag, checks for new commits, updates version files, and publishes the next patch tag when needed. ChangesWeekly patch release
Sequence Diagram(s)sequenceDiagram
participant Trigger as Schedule or manual trigger
participant Workflow as weekly_patch job
participant Repository as GitHub repository
participant VersionScript as update_version_numbers.sh
Trigger->>Workflow: Start patch release job
Workflow->>Repository: Authenticate and checkout full history
Workflow->>Repository: Find release branch and latest patch tag
Workflow->>Workflow: Count commits since patch tag
Workflow->>VersionScript: Update version files when changes exist
VersionScript->>Repository: Push release-branch commit
Workflow->>Repository: Push next patch tag
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the weekly trail, Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/weekly_patch_workflow.yml (1)
35-37: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAnchor the branch regex to prevent matching unexpected suffixes.
The
greppattern will match any branch name that contains the pattern, such asorigin/releases/v3.6.0-wipororigin/releases/v3.6.0.1. Adding an end-of-line anchor ($) ensures only strict release branches are matched.🛠️ Proposed fix
# 1. Identify the latest release branch (matching pattern releases/vN.M.0) - LATEST_BRANCH=$(git branch -r | grep -E 'origin/releases/v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/.*origin\///' | sort -V | tail -n 1) + LATEST_BRANCH=$(git branch -r | grep -E 'origin/releases/v[0-9]+\.[0-9]+\.[0-9]+$' | sed 's/.*origin\///' | sort -V | tail -n 1)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/weekly_patch_workflow.yml around lines 35 - 37, Update the branch filter used to assign LATEST_BRANCH so its grep regular expression is anchored at the end of the line, matching only strict releases/vN.M.0 branch names and excluding suffixes such as -wip or an additional version component.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/weekly_patch_workflow.yml:
- Around line 52-54: Update the LATEST_TAG selection in the weekly patch
workflow to filter tags against a strict stable semantic-version pattern
matching only vMAJOR.MINOR.PATCH, excluding pre-release and release-candidate
suffixes before sorting and selecting the latest tag. Preserve the existing
version ordering and latest-tag behavior for valid stable tags.
- Around line 17-20: Update the actions/checkout step to use the RELEASE_PAT
secret via its token input instead of the default GITHUB_TOKEN, while preserving
fetch-depth: 0 so tag pushes can trigger downstream release workflows.
---
Nitpick comments:
In @.github/workflows/weekly_patch_workflow.yml:
- Around line 35-37: Update the branch filter used to assign LATEST_BRANCH so
its grep regular expression is anchored at the end of the line, matching only
strict releases/vN.M.0 branch names and excluding suffixes such as -wip or an
additional version component.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f8867e05-f57e-4b8c-bc60-922425cc35e7
📒 Files selected for processing (1)
.github/workflows/weekly_patch_workflow.yml
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/weekly_patch_workflow.yml (1)
17-22: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winScope the GitHub App token to the current repository.
By default, the generated token inherits all permissions across all repositories accessible to the GitHub App installation. To follow the principle of least privilege and limit potential impact if the token is exposed, explicitly scope the token to just the current repository.
🛡️ Proposed fix to limit token scope
- name: Generate GitHub App token id: app-token uses: actions/create-github-app-token@v2 with: app-id: ${{ vars.OPENMS_GITHUB_APP_ID }} private-key: ${{ secrets.OPENMS_GITHUB_APP_PRIVATE_KEY }} + repositories: ${{ github.event.repository.name }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/weekly_patch_workflow.yml around lines 17 - 22, Add the current repository restriction to the create-github-app-token step identified by id app-token, configuring its repository input to scope the generated token exclusively to the repository running the workflow while preserving the existing app credentials.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/weekly_patch_workflow.yml:
- Around line 17-22: Add the current repository restriction to the
create-github-app-token step identified by id app-token, configuring its
repository input to scope the generated token exclusively to the repository
running the workflow while preserving the existing app credentials.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c8051c2f-2539-4d98-847f-9b6ee23b9be1
📒 Files selected for processing (1)
.github/workflows/weekly_patch_workflow.yml
pjones
left a comment
There was a problem hiding this comment.
Looks really good. I only have a few very minor suggestions.
| else | ||
| # safety net in case tag does not exist for the branch (should not happen though) | ||
| echo "Tag $LATEST_TAG does not exist. Assuming initial execution." | ||
| COMMITS_SINCE_TAG=1 |
There was a problem hiding this comment.
Even though this says "(should not happen though)" I think it can.
If git tag -l doesn't match anything then line 67 sets LATEST_TAG to a non-existent tag. Now, that probably can't happen if you've made it this far in the script. But to be cautious I think we should set COMMITS_SINCE_TAG to 0 in this case. I'd rather error on the side of not making bogus releases.
|
|
||
| if [[ -z "$LATEST_BRANCH" ]]; then | ||
| echo "::error::No release branches matching 'releases/vN.M.0' found." | ||
| exit 1 |
There was a problem hiding this comment.
I wonder if we should exit with success and set changes_exist=false. If we merge this today it will fail until we get the rest of the release process in place and have released the next version of OpenMS. Thoughts?
There was a problem hiding this comment.
True I guess that this will fail today. Was too future looking when I wrote this. I'll comment this line out and exit with success for now but it might be worth throwing an error in the future when we get the release process all up and running.
There was a problem hiding this comment.
I don't think it is enough to just mark "changes_exist=false" since the git checkout will fail on the next line so will just exit in success for now with the warning message.
| - name: Configure Git identity | ||
| run: | | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" |
There was a problem hiding this comment.
I believe that RFC 5322 forbids the use of square brackets in the local part of an email address. It can only be made up of dot-separated atext characters. Also, I know way too much about email addresses.
There was a problem hiding this comment.
Even though this is a violation, I've seen it used a lot for github action workflows so I think it is probably best to keep it as it has become pseudo-standard.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/update_version_numbers.yml (1)
73-98: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the fixed update branch.
Line 73 creates a branch name that includes
NEW_VERSION. Each tag push therefore creates a separate branch and pull request. Reuseupdate_package_numberfor checkout, push, andgh prlookup so that later tag pushes update the same pull request.Based on learnings: maintainer pjones prefers the fixed branch name
update_package_numberto prevent orphaned branches.Proposed change
- FULL_BRANCH_NAME=${BRANCH_NAME}_${NEW_VERSION} - # 2. Configure Git using the actor's identity git config --global user.name "${{ github.actor }}" git config --global user.email "${{ github.actor }}`@users.noreply.github.com`" # 3. Checkout a clean branch and commit changes - git checkout -b "$FULL_BRANCH_NAME" + git checkout -B "$BRANCH_NAME" git add . git commit -m "Updated OpenMS package version number to $NEW_VERSION" # 4. Force push the changes to keep the PR branch updated - git push origin "$FULL_BRANCH_NAME" --force + git push origin "$BRANCH_NAME" --force - PR_EXISTS=$(gh pr list --head "$FULL_BRANCH_NAME" --base develop --state open --json number --jq '.[].number') + PR_EXISTS=$(gh pr list --head "$BRANCH_NAME" --base develop --state open --json number --jq '.[].number')🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/update_version_numbers.yml around lines 73 - 98, Replace the version-suffixed FULL_BRANCH_NAME flow with the fixed branch name update_package_number. Update git checkout, push, PR lookup, and PR creation references to consistently use update_package_number so subsequent tag pushes reuse the same branch and pull request.Source: Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/update_version_numbers.yml:
- Line 82: Update the git commit message in the workflow’s version-update step
to use the required [TAG1,TAG2] prefix, such as [GHA,VERSION], while retaining
$NEW_VERSION in the summary.
In `@CHANGELOG`:
- Line 20: Update the changelog entry’s reference to the target gated by
BUILD_TOPP_TOOLS: replace the incorrect TOPP_TOOLS target name with the actual
aggregate CMake target TOPP, while retaining the surrounding feature
description.
---
Nitpick comments:
In @.github/workflows/update_version_numbers.yml:
- Around line 73-98: Replace the version-suffixed FULL_BRANCH_NAME flow with the
fixed branch name update_package_number. Update git checkout, push, PR lookup,
and PR creation references to consistently use update_package_number so
subsequent tag pushes reuse the same branch and pull request.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2492b04c-70a7-472e-b2d4-5d92f8ee9c68
📒 Files selected for processing (12)
.github/workflows/pyopenms-wheels-cibuildwheel.yml.github/workflows/update_version_numbers.yml.github/workflows/weekly_patch_workflow.ymlCHANGELOGCMakeLists.txtcmake/OpenMSConfig.cmake.incmake/cmake_findExternalLibs.cmakedoc/CMakeLists.txtsrc/CMakeLists.txtsrc/openms/CMakeLists.txtsrc/openms/include/OpenMS/FORMAT/sources.cmakesrc/tests/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/weekly_patch_workflow.yml
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/update_version_numbers.yml (1)
73-98: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the fixed update branch.
Line 73 creates a branch name that includes
NEW_VERSION. Each tag push therefore creates a separate branch and pull request. Reuseupdate_package_numberfor checkout, push, andgh prlookup so that later tag pushes update the same pull request.Based on learnings: maintainer pjones prefers the fixed branch name
update_package_numberto prevent orphaned branches.Proposed change
- FULL_BRANCH_NAME=${BRANCH_NAME}_${NEW_VERSION} - # 2. Configure Git using the actor's identity git config --global user.name "${{ github.actor }}" git config --global user.email "${{ github.actor }}`@users.noreply.github.com`" # 3. Checkout a clean branch and commit changes - git checkout -b "$FULL_BRANCH_NAME" + git checkout -B "$BRANCH_NAME" git add . git commit -m "Updated OpenMS package version number to $NEW_VERSION" # 4. Force push the changes to keep the PR branch updated - git push origin "$FULL_BRANCH_NAME" --force + git push origin "$BRANCH_NAME" --force - PR_EXISTS=$(gh pr list --head "$FULL_BRANCH_NAME" --base develop --state open --json number --jq '.[].number') + PR_EXISTS=$(gh pr list --head "$BRANCH_NAME" --base develop --state open --json number --jq '.[].number')🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/update_version_numbers.yml around lines 73 - 98, Replace the version-suffixed FULL_BRANCH_NAME flow with the fixed branch name update_package_number. Update git checkout, push, PR lookup, and PR creation references to consistently use update_package_number so subsequent tag pushes reuse the same branch and pull request.Source: Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/update_version_numbers.yml:
- Line 82: Update the git commit message in the workflow’s version-update step
to use the required [TAG1,TAG2] prefix, such as [GHA,VERSION], while retaining
$NEW_VERSION in the summary.
In `@CHANGELOG`:
- Line 20: Update the changelog entry’s reference to the target gated by
BUILD_TOPP_TOOLS: replace the incorrect TOPP_TOOLS target name with the actual
aggregate CMake target TOPP, while retaining the surrounding feature
description.
---
Nitpick comments:
In @.github/workflows/update_version_numbers.yml:
- Around line 73-98: Replace the version-suffixed FULL_BRANCH_NAME flow with the
fixed branch name update_package_number. Update git checkout, push, PR lookup,
and PR creation references to consistently use update_package_number so
subsequent tag pushes reuse the same branch and pull request.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2492b04c-70a7-472e-b2d4-5d92f8ee9c68
📒 Files selected for processing (12)
.github/workflows/pyopenms-wheels-cibuildwheel.yml.github/workflows/update_version_numbers.yml.github/workflows/weekly_patch_workflow.ymlCHANGELOGCMakeLists.txtcmake/OpenMSConfig.cmake.incmake/cmake_findExternalLibs.cmakedoc/CMakeLists.txtsrc/CMakeLists.txtsrc/openms/CMakeLists.txtsrc/openms/include/OpenMS/FORMAT/sources.cmakesrc/tests/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/weekly_patch_workflow.yml
🛑 Comments failed to post (2)
.github/workflows/update_version_numbers.yml (1)
82-82: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use the required commit-message format.
The generated message has no
[TAG1,TAG2]prefix. Use a compliant summary, such as[GHA,VERSION] Update OpenMS package version to $NEW_VERSION.As per coding guidelines: “Use commit messages formatted as
[TAG1,TAG2] short summary.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/update_version_numbers.yml at line 82, Update the git commit message in the workflow’s version-update step to use the required [TAG1,TAG2] prefix, such as [GHA,VERSION], while retaining $NEW_VERSION in the summary.Source: Coding guidelines
CHANGELOG (1)
20-20: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use the actual CMake target name in the changelog.
Line 20 calls
TOPP_TOOLSa target. Insrc/topp/CMakeLists.txtlines 61-67,TOPPis the aggregate CMake target, whileTOPP_TOOLSis an internal cache variable containing the tool list. Update the wording.Proposed wording change
-its TOPP_TOOLS target +the TOPP target and TOPP_TOOLS cache list📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.- Feature: standalone consumers can now build and install a core-only OpenMS SDK by disabling TOPP tools and GUI support. New CMake options BUILD_TOPP_TOOLS (default ON) gates the src/topp subdirectory and the TOPP target and TOPP_TOOLS cache list, and INSTALL_OPENMS_EXAMPLES (default ON) gates installing the example data; TOPP/pipeline tests (ENABLE_TOPP_TESTING, ENABLE_PIPELINE_TESTING) default to following BUILD_TOPP_TOOLS, and ENABLE_CWL_GENERATION / ENABLE_PREPARE_KNIME_PACKAGE now fail configuration with a clear error if requested while BUILD_TOPP_TOOLS is OFF instead of breaking later in the build. The installed core SDK now also ships the OpenMS BSD-3-Clause license and the public Bruker tims imaging header, and the Thermo RawFileReader license is assigned to the 'share' install component. Defaults are unchanged, so existing full OpenMS builds retain current behavior (`#9752`)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@CHANGELOG` at line 20, Update the changelog entry’s reference to the target gated by BUILD_TOPP_TOOLS: replace the incorrect TOPP_TOOLS target name with the actual aggregate CMake target TOPP, while retaining the surrounding feature description.
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/weekly_patch_workflow.yml:
- Around line 44-45: Update the LATEST_BRANCH extraction to match only complete
release branch names in the releases/vN.M.0 format, requiring the final numeric
component to be 0 and anchoring the pattern to the full branch name. Exclude
patch releases such as vN.M.1 and suffixed names such as vN.M.0-rc while
preserving the existing sorting and latest-branch selection.
- Around line 12-14: Add a GitHub Actions concurrency group to the weekly_patch
workflow so scheduled and manually triggered runs cannot execute simultaneously.
Configure the group at the workflow or weekly_patch job level, using an
appropriate stable identifier and preserving the existing ubuntu-latest runner
configuration.
- Around line 107-116: Update the release flow around the commit push and tag
creation so the version-bump branch ref and NEW_TAG are pushed together in a
single atomic git push. Create the tag before pushing, remove the separate
branch and tag push commands, and preserve the existing commit message and tag
naming.
- Around line 19-22: Add the create-github-app-token step’s permission-contents
input with a write value, alongside app-id and private-key, so the generated
token is limited to the repository contents permission.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 40dcd47b-3147-4599-8d7d-26d33642d566
📒 Files selected for processing (1)
.github/workflows/weekly_patch_workflow.yml
| jobs: | ||
| weekly_patch: | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Serialize patch-release executions.
A manual run can overlap the scheduled run. Both runs can calculate the same NEW_PATCH, and one run can fail after the other publishes the release. GitHub Actions permits concurrent workflow runs unless a concurrency group restricts them. (docs.github.com)
Proposed fix
weekly_patch:
+ concurrency:
+ group: weekly-openms-patch-release
+ cancel-in-progress: false
runs-on: ubuntu-latest📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| jobs: | |
| weekly_patch: | |
| runs-on: ubuntu-latest | |
| jobs: | |
| weekly_patch: | |
| concurrency: | |
| group: weekly-openms-patch-release | |
| cancel-in-progress: false | |
| runs-on: ubuntu-latest |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/weekly_patch_workflow.yml around lines 12 - 14, Add a
GitHub Actions concurrency group to the weekly_patch workflow so scheduled and
manually triggered runs cannot execute simultaneously. Configure the group at
the workflow or weekly_patch job level, using an appropriate stable identifier
and preserving the existing ubuntu-latest runner configuration.
| uses: actions/create-github-app-token@v2 | ||
| with: | ||
| app-id: ${{ vars.OPENMS_GITHUB_APP_ID }} | ||
| private-key: ${{ secrets.OPENMS_GITHUB_APP_PRIVATE_KEY }} |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/weekly_patch_workflow.yml
printf '%s\n' '--- token-action references ---'
rg -n -C 4 'create-github-app-token|permission-[a-z-]+|permissions:' .github/workflows .github 2>/dev/null || trueRepository: OpenMS/OpenMS
Length of output: 33885
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- create-github-app-token@v2 action metadata ---'
curl -fsSL https://raw.githubusercontent.com/actions/create-github-app-token/v2/action.yml |
sed -n '1,220p'
printf '%s\n' '--- workflow command usage ---'
python3 - <<'PY'
from pathlib import Path
p = Path(".github/workflows/weekly_patch_workflow.yml")
text = p.read_text()
for i, line in enumerate(text.splitlines(), 1):
if 16 <= i <= 117 and any(x in line for x in ("git ", "bash ", "uses:", "with:", "token:", "permission-")):
print(f"{i}: {line}")
PYRepository: OpenMS/OpenMS
Length of output: 12397
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- action documentation for permission behavior ---'
curl -fsSL https://raw.githubusercontent.com/actions/create-github-app-token/v2/README.md |
rg -n -A 18 -B 8 'permission-contents|permissions|If you do not specify any permissions|only those permissions'
printf '%s\n' '--- action implementation references ---'
curl -fsSL https://raw.githubusercontent.com/actions/create-github-app-token/v2/dist/main.cjs |
rg -o -n '.{0,180}(permission-|permissions|permissionsToRequest).{0,240}' |
head -n 40Repository: OpenMS/OpenMS
Length of output: 6368
Restrict the GitHub App token permissions.
This workflow only uses repository contents access. Add permission-contents: write to the token step. Without this input, the token inherits all installation permissions.
🧰 Tools
🪛 zizmor (1.29.0)
[error] 19-19: dangerous use of GitHub App tokens (github-app): app token inherits blanket installation permissions
(github-app)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/weekly_patch_workflow.yml around lines 19 - 22, Add the
create-github-app-token step’s permission-contents input with a write value,
alongside app-id and private-key, so the generated token is limited to the
repository contents permission.
Source: Linters/SAST tools
| # 1. Identify the latest release branch (matching pattern releases/vN.M.0) | ||
| LATEST_BRANCH=$(git branch -r | grep -E 'origin/releases/v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/.*origin\///' | sort -V | tail -n 1) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Match only complete release-branch names.
The expression accepts releases/vN.M.1 and prefixes such as releases/vN.M.0-rc. If either branch exists, the workflow can update and tag the wrong branch.
Proposed fix
- LATEST_BRANCH=$(git branch -r | grep -E 'origin/releases/v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/.*origin\///' | sort -V | tail -n 1)
+ LATEST_BRANCH=$(git branch -r | sed -nE 's|^[[:space:]]*origin/(releases/v[0-9]+\.[0-9]+\.0)$|\1|p' | sort -V | tail -n 1)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # 1. Identify the latest release branch (matching pattern releases/vN.M.0) | |
| LATEST_BRANCH=$(git branch -r | grep -E 'origin/releases/v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/.*origin\///' | sort -V | tail -n 1) | |
| # 1. Identify the latest release branch (matching pattern releases/vN.M.0) | |
| LATEST_BRANCH=$(git branch -r | sed -nE 's|^[[:space:]]*origin/(releases/v[0-9]+\.[0-9]+\.0)$|\1|p' | sort -V | tail -n 1) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/weekly_patch_workflow.yml around lines 44 - 45, Update the
LATEST_BRANCH extraction to match only complete release branch names in the
releases/vN.M.0 format, requiring the final numeric component to be 0 and
anchoring the pattern to the full branch name. Exclude patch releases such as
vN.M.1 and suffixed names such as vN.M.0-rc while preserving the existing
sorting and latest-branch selection.
| # 2. Commit and push the version updates back to the release branch | ||
| git add . | ||
| git commit -m "Bump version to $MAJOR.$MINOR.$NEW_PATCH" | ||
| git push origin HEAD:"$BRANCH_NAME" | ||
|
|
||
| # 3. Tag the release branch with vN.M.(P+1) and push it | ||
| NEW_TAG="v$MAJOR.$MINOR.$NEW_PATCH" | ||
| echo "Tagging and pushing $NEW_TAG..." | ||
| git tag "$NEW_TAG" | ||
| git push origin "$NEW_TAG" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Push the version commit and tag atomically.
If the tag push fails, line 110 has already published the version-bump commit. The release branch then has a new version without its corresponding patch tag. Push both refs with one atomic operation.
Proposed fix
git add .
git commit -m "Bump version to $MAJOR.$MINOR.$NEW_PATCH"
- git push origin HEAD:"$BRANCH_NAME"
# 3. Tag the release branch with vN.M.(P+1) and push it
NEW_TAG="v$MAJOR.$MINOR.$NEW_PATCH"
echo "Tagging and pushing $NEW_TAG..."
git tag "$NEW_TAG"
- git push origin "$NEW_TAG"
+ git push --atomic origin HEAD:"$BRANCH_NAME" "refs/tags/$NEW_TAG"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # 2. Commit and push the version updates back to the release branch | |
| git add . | |
| git commit -m "Bump version to $MAJOR.$MINOR.$NEW_PATCH" | |
| git push origin HEAD:"$BRANCH_NAME" | |
| # 3. Tag the release branch with vN.M.(P+1) and push it | |
| NEW_TAG="v$MAJOR.$MINOR.$NEW_PATCH" | |
| echo "Tagging and pushing $NEW_TAG..." | |
| git tag "$NEW_TAG" | |
| git push origin "$NEW_TAG" | |
| # 2. Commit and push the version updates back to the release branch | |
| git add . | |
| git commit -m "Bump version to $MAJOR.$MINOR.$NEW_PATCH" | |
| # 3. Tag the release branch with vN.M.(P+1) and push it | |
| NEW_TAG="v$MAJOR.$MINOR.$NEW_PATCH" | |
| echo "Tagging and pushing $NEW_TAG..." | |
| git tag "$NEW_TAG" | |
| git push --atomic origin HEAD:"$BRANCH_NAME" "refs/tags/$NEW_TAG" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/weekly_patch_workflow.yml around lines 107 - 116, Update
the release flow around the commit push and tag creation so the version-bump
branch ref and NEW_TAG are pushed together in a single atomic git push. Create
the tag before pushing, remove the separate branch and tag push commands, and
preserve the existing commit message and tag naming.
|
@pjones I realised that this PR never got merged. Is this PR still relevant or was it already implemented. Currently we cannot merge since "this branch cannot be rebased due to conflict" |
|
Yes, we still need this. It will need to be rebased and merged after @timosachsenberg releases OpenMS 3.6.0. |
da891ba to
576f87c
Compare
general outline Workflow kicks off once a week on a schedule (patch Tuesday?) Find the latest release branch (releases/vN.M.0). Check out that branch. Check if there have been any commits since the last tag matching vN.M.P. If there haven't been any commits then the workflow should exit with success or otherwise deactivate the remaining steps. Update the version number on the release branch, commit and push. Tag the release branch with vN.M.(P+1) Push the tag, triggering the normal release process.
576f87c to
21ffa3e
Compare
Description
This PR creates a new github action that will be used for patch releases.
Follows the general outline as described by @pjones
Workflow kicks off once a week on a schedule (patch Tuesday?)
Find the latest release branch (releases/vN.M.0).
Check out that branch.
Check if there have been any commits since the last tag matching
vN.M.P. If there haven't been any commits then the workflow should
exit with success or otherwise deactivate the remaining steps.
Update the version number on the release branch, commit and push.
Tag the release branch with vN.M.(P+1)
Push the tag, triggering the normal release process.
Proper functioning is dependent on merge of #9742
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI buildsSummary by CodeRabbit