Skip to content

Conversation

cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Oct 7, 2025

Without this patch, every 4.0 release will be marked as the latest release.
This could be inconvenient for releasing process of 4.0.x.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • Chores
    • Updated release workflow to publish two distinct releases: a 4.0 release that is not marked as “latest” and a 4.1 release that is marked as “latest” when applicable.
    • Introduced conditional logic to route 4.1 versions through the latest release path while keeping 4.0 on a non-latest path.
    • Improves clarity of versioning and “latest” designation for end users tracking releases.

@cosmo0920 cosmo0920 marked this pull request as ready for review October 7, 2025 08:05
Copy link

coderabbitai bot commented Oct 7, 2025

Walkthrough

The staging-release GitHub Actions workflow now splits the release process: 4.0 releases are created as non-latest, while 4.1 releases are created as latest. A new conditional gates the 4.1 path with startsWith(inputs.version, '4.1'). Shared settings remain identical aside from tag_name and make_latest.

Changes

Cohort / File(s) Summary
Workflow: staged releases by version
.github/workflows/staging-release.yaml
Replaced the combined "4.0 and latest" step with two steps: (1) "Release 4.0 - not latest" (make_latest: false) and (2) "Release 4.1 and latest" (make_latest: true). Introduced conditional startsWith(inputs.version, '4.1') for the 4.1 path. Shared body/draft/release-notes; differing tag_name and make_latest.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant GH as GitHub Actions (staging-release)
    participant Job as Release Job
    participant Rel as create-release Action

    Dev->>GH: Dispatch workflow with inputs.version
    GH->>Job: Start job
    alt version starts with "4.1"
        Job->>Rel: Create "4.1 and latest" release<br/>(make_latest=true, tag_name=4.1.x)
        Rel-->>Job: Release created
    else version starts with "4.0"
        Job->>Rel: Create "4.0 - not latest" release<br/>(make_latest=false, tag_name=4.0.x)
        Rel-->>Job: Release created
    end
    Job-->>GH: Job complete
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • niedbalski
  • celalettin1286
  • patrick-stephens

Poem

I hop through tags, 4.0 to 4.1’s light,
Flip a latest switch—left off, then on just right.
Branching paths in YAML’s warren tight,
Carrots of releases, crisp and bright.
Thump! A tidy flow for versioned night. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly identifies the primary change to the workflow, namely that 4.0 branch releases should no longer be marked as the “latest” release, and directly references the workflow context and branch affected.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cosmo0920-make-only-4.1-as-latest-for-releasing

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/staging-release.yaml (2)

504-507: Bug: “latest” container tags still update for 4.0.x; restrict to 4.1 only

Condition matches any 4.x, so 4.0 releases will still publish latest tags. Update condition and comment.

Apply:

-  staging-release-images-latest-tags:
-    # Only update latest tags for 4.0 releases
-    if: startsWith(github.event.inputs.version, '4.')
+  staging-release-images-latest-tags:
+    # Only update latest tags for 4.1 releases
+    if: startsWith(github.event.inputs.version, '4.1')

964-970: Handle docs checkout for 4.1 and explicit refs

  • Rename the 4.0 step to “Release 4.0 – not latest” and add ref: 4.0.
  • Add a new “Release 4.1 and latest” step under startsWith(inputs.version, '4.1') checking out fluent/fluent-bit-docs at master.

Confirm that the docs repo uses branch 4.0 for 4.0.x and master for 4.1+ (adjust refs if different).

🧹 Nitpick comments (2)
.github/workflows/staging-release.yaml (2)

834-844: 4.0 release correctly marked non-latest; add target_commitish for consistency

Good change. For parity with 2.x/3.x blocks, set target_commitish to the 4.0 branch.

       - name: Release 4.0 - not latest
         uses: softprops/action-gh-release@v2
         if: startsWith(inputs.version, '4.0')
         with:
           body: "https://fluentbit.io/announcements/v${{ inputs.version }}/"
           draft: false
           generate_release_notes: true
           name: "Fluent Bit ${{ inputs.version }}"
           tag_name: v${{ inputs.version }}
+          target_commitish: '4.0'
           make_latest: false

845-855: 4.1 release as latest: add target_commitish for clarity

Works as intended. Consider pinning to master explicitly.

       - name: Release 4.1 and latest
         uses: softprops/action-gh-release@v2
         if: startsWith(inputs.version, '4.1')
         with:
           body: "https://fluentbit.io/announcements/v${{ inputs.version }}/"
           draft: false
           generate_release_notes: true
           name: "Fluent Bit ${{ inputs.version }}"
           tag_name: v${{ inputs.version }}
+          target_commitish: 'master'
           make_latest: true
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ffd27bc and 21112c9.

📒 Files selected for processing (1)
  • .github/workflows/staging-release.yaml (1 hunks)

@patrick-stephens
Copy link
Collaborator

@cosmo0920 let's ensure the target commitish is set like CodeRabbit says too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants