Skip to content

Go releaser config support draft mode#1353

Merged
goruha merged 6 commits intomainfrom
go-release-config-support-draft-mode
Jun 25, 2025
Merged

Go releaser config support draft mode#1353
goruha merged 6 commits intomainfrom
go-release-config-support-draft-mode

Conversation

@goruha
Copy link
Member

@goruha goruha commented Jun 25, 2025

what

  • Go releaser config support draft mode

why

  • Increase velocity for feature releases

Summary by CodeRabbit

  • Chores
    • Updated build configuration to adjust supported operating systems and architectures based on environment variables during release packaging. End users may see different platform options depending on release conditions.
    • Added a new release job to the continuous integration workflow to streamline release processes triggered on code pushes.

@goruha goruha requested a review from a team as a code owner June 25, 2025 11:49
@github-actions github-actions bot added the size/s Small size PR label Jun 25, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 25, 2025

📝 Walkthrough
## Walkthrough

The GoReleaser configuration was updated to conditionally set build targets for operating systems and architectures based on specific environment variables. The selection logic uses Go templating to restrict or expand the target list, while the rest of the build configuration remains unchanged. Additionally, a new `release` job was added to the GitHub Actions workflow, triggered on push events and using a reusable workflow.

## Changes

| File(s)                    | Change Summary                                                                                                           |
|----------------------------|-------------------------------------------------------------------------------------------------------------------------|
| .goreleaser.yml            | Added conditional logic using Go templating to set OS and architecture targets based on environment variables.           |
| .github/workflows/test.yml | Added a new `release` job that depends on multiple prior jobs and uses a reusable workflow, triggered on push events.    |

## Possibly related PRs

- cloudposse/atmos#721: Adds or modifies the `release` job in the GitHub Actions workflow, focusing on release process automation.
- cloudposse/atmos#1350: Moves the `release` job to a separate workflow, modifying the same release job but with different structuring.
- cloudposse/atmos#1281: Adjusts the release job triggers and parameters, related to the same GitHub Actions release job.

## Suggested labels

`minor`

## Suggested reviewers

- aknysh
✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch go-release-config-support-draft-mode

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or @auto-summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @auto-title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5521295 and bb7e6c8.

📒 Files selected for processing (1)
  • .goreleaser.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.goreleaser.yml

[error] 15-15: syntax error: could not find expected ':'

(syntax)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Analyze (go)
  • GitHub Check: Summary

@goruha goruha added the no-release Do not create a new release (wait for additional code changes) label Jun 25, 2025
Copy link
Contributor

@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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb7e6c8 and a16a1ae.

📒 Files selected for processing (1)
  • .goreleaser.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.goreleaser.yml

[error] 15-15: syntax error: could not find expected ':'

(syntax)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Analyze (go)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Summary
🔇 Additional comments (2)
.goreleaser.yml (2)

13-22: (FYI) YAML-lint error is a false positive

The linter flags a syntax error at line 15 because it can’t parse the Go template directives.
GoReleaser tolerates these blocks just fine, so no action is needed here.

Also applies to: 23-32


14-17: Good catch on .Env map access

Switching to index .Env "GO_RELEASER_TARGET_COMMITISH" fixes the dead-code path pointed out in the previous review.
Nice cleanup!

Also applies to: 24-27

@codecov
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.38%. Comparing base (2ae8f49) to head (a3f7380).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1353      +/-   ##
==========================================
+ Coverage   51.33%   51.38%   +0.04%     
==========================================
  Files         243      243              
  Lines       26230    26230              
==========================================
+ Hits        13464    13477      +13     
+ Misses      11101    11083      -18     
- Partials     1665     1670       +5     
Flag Coverage Δ
unittests 51.38% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@mergify
Copy link

mergify bot commented Jun 25, 2025

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label Jun 25, 2025
osterman
osterman previously approved these changes Jun 25, 2025
Copy link
Contributor

@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: 1

🧹 Nitpick comments (1)
.github/workflows/test.yml (1)

531-531: Guard condition may still trigger on tag pushes.

github.event_name == 'push' fires for both branch and tag pushes that meet the workflow-level branch filter.
If the release job should only run for branch pushes (e.g. main, release/v*), add an explicit ref-type check:

-    if: github.event_name == 'push'
+    if: github.event_name == 'push' && github.ref_type == 'branch'

Double-check that this matches the intended release cadence.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a16a1ae and 5cf3226.

📒 Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Analyze (go)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Summary

Copy link
Contributor

@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

🧹 Nitpick comments (1)
.goreleaser.yml (1)

24-32: DRY up the duplicated template logic
The identical if expression appears in both goos and goarch. Hoist it into a helper variable to avoid drift and improve readability:

-    goarch:
-{{ if and (eq (index .Env "GO_RELEASER_DRAFT_MODE") "true") (eq (index .Env "GO_RELEASER_TARGET_COMMITISH") "true") }}
+    {{- $draft := and (eq (index .Env "GO_RELEASER_DRAFT_MODE") "true") (eq (index .Env "GO_RELEASER_TARGET_COMMITISH") "true") -}}
+    goarch:
+{{ if $draft }}

Repeat the same $draft check for the goos list above. Keeps future edits to the condition in one place.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5cf3226 and 18d6d3f.

📒 Files selected for processing (1)
  • .goreleaser.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.goreleaser.yml

[error] 15-15: syntax error: could not find expected ':'

(syntax)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Analyze (go)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Summary
🔇 Additional comments (2)
.goreleaser.yml (2)

14-17: Condition now reads the env map correctly – well done
Switching to index + eq fixes the dead-code path flagged earlier and makes the intent explicit.


14-32: Re-confirm the “true” string convention
The logic now requires both env vars to be exactly the string "true". If CI sets them to "1" or any other non-empty value, the restricted target list will be skipped. Double-check that pipeline/export scripts indeed export "true" (not just set/unset).

coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 25, 2025
Copy link
Contributor

@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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18d6d3f and a3f7380.

📒 Files selected for processing (1)
  • .goreleaser.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.goreleaser.yml

[error] 15-15: syntax error: could not find expected ':'

(syntax)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Summary

@goruha goruha added patch A minor, backward compatible change and removed no-release Do not create a new release (wait for additional code changes) labels Jun 25, 2025
@goruha goruha enabled auto-merge (squash) June 25, 2025 17:41
@goruha goruha merged commit 48608f0 into main Jun 25, 2025
62 checks passed
@goruha goruha deleted the go-release-config-support-draft-mode branch June 25, 2025 17:43
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Jun 25, 2025
This was referenced Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A minor, backward compatible change size/s Small size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants