Skip to content

Conversation

@dlabrecq
Copy link
Contributor

@dlabrecq dlabrecq commented Nov 19, 2025

Adds a prefix to help identify tags for each app.

Summary by Sourcery

CI:

  • Extract the app prefix from the branch name and embed it in the release tag format

@dlabrecq dlabrecq requested a review from a team as a code owner November 19, 2025 15:32
@gemini-code-assist
Copy link
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 19, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR enhances the GitHub Actions tag_release workflow to derive an application-specific prefix from the branch name and embed it into the release tag format.

Flow diagram for release tag generation with app prefix

flowchart TD
  Start([Start]) --> GetBranch["Get branch name from env.BRANCH"]
  GetBranch --> DerivePrefix["Derive APP_PREFIX by splitting branch name"]
  DerivePrefix --> CheckPrevRelease["Check previous release tag"]
  CheckPrevRelease --> SetMinorVersion["Set MINOR_VERSION"]
  SetMinorVersion --> FormatTag["Format tag as r-APP_PREFIX.DATE.MINOR_VERSION"]
  FormatTag --> CreateTag["Create annotated git tag"]
  CreateTag --> End([End])
Loading

File-Level Changes

Change Details Files
Introduce APP_PREFIX extraction from the branch name
  • Add APP_PREFIX variable utilizing BRANCH env parsed with cut
  • Pipe branch string through delimiter to isolate the app identifier
.github/workflows/tag_release.yml
Revise tag construction to include the new prefix
  • Change TAG assignment to insert APP_PREFIX between 'r' and the date
  • Switch separator after 'r' from dot to hyphen for consistency
.github/workflows/tag_release.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `.github/workflows/tag_release.yml:26` </location>
<code_context>
           DATE=$(date +"%Y.%m.%d")
           PREV_RELEASE=$(git tag --list | tail -1)
           MINOR_VERSION=0
+          APP_PREFIX=${{ env.BRANCH }} | cut -d'-' -f2
           case $PREV_RELEASE in
             *"$DATE"*)
</code_context>

<issue_to_address>
**issue (bug_risk):** Shell variable assignment syntax is incorrect for piping and command substitution.

Use command substitution to ensure the pipe operates within the assignment: APP_PREFIX=$(echo "${{ env.BRANCH }}" | cut -d'-' -f2).
</issue_to_address>

### Comment 2
<location> `.github/workflows/tag_release.yml:36` </location>
<code_context>
               ;;
           esac
-          TAG="r.$DATE.$MINOR_VERSION"
+          TAG="r-$APP_PREFIX.$DATE.$MINOR_VERSION"
           git config --local user.email "[email protected]"
           git config --local user.name "Cost Management Release Action"
</code_context>

<issue_to_address>
**suggestion:** TAG format now includes APP_PREFIX, which may be empty if extraction fails.

Add a validation step to ensure APP_PREFIX is not empty before constructing the tag.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.07%. Comparing base (df6862f) to head (9abf8ef).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4680   +/-   ##
=======================================
  Coverage   87.07%   87.07%           
=======================================
  Files         480      480           
  Lines        9078     9078           
  Branches     2197     2194    -3     
=======================================
  Hits         7905     7905           
+ Misses       1108     1107    -1     
- Partials       65       66    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dlabrecq dlabrecq merged commit cc8b1f4 into project-koku:main Nov 19, 2025
9 checks passed
@dlabrecq dlabrecq deleted the workflow branch November 19, 2025 16:33
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.

1 participant