Skip to content

fix(casks): binary packages need to rename to binary#5840

Merged
caarlos0 merged 1 commit intomainfrom
binary-cask
Jun 17, 2025
Merged

fix(casks): binary packages need to rename to binary#5840
caarlos0 merged 1 commit intomainfrom
binary-cask

Conversation

@caarlos0
Copy link
Copy Markdown
Member

@caarlos0 caarlos0 requested a review from Copilot June 17, 2025 14:35
@caarlos0 caarlos0 self-assigned this Jun 17, 2025
@caarlos0 caarlos0 added the bug Something isn't working label Jun 17, 2025
@pull-request-size pull-request-size Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 17, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for naming and targeting binary packages in Homebrew Cask outputs by extending the data model, rendering logic, and templates accordingly.

  • Extend templateData and releasePackage with HasOnlyBinaryPkgs, Name, and Binary to capture binary package metadata.
  • Update cask.go to populate and count binary artifacts, and set the HasOnlyBinaryPkgs flag.
  • Modify Ruby templates to conditionally emit binary "<name>", target: "<binary>" and adjust the default cask template to skip binary-only cases.
  • Refresh testdata golden files to reflect the new binary …, target: … stanzas.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/pipe/cask/testdata/TestRunPipePullRequest.rb.golden Add binary "foo_macos", target: "foo" in pull-request scenario
internal/pipe/cask/testdata/TestRunPipeBinaryRelease.rb.golden Remove generic binary "foo" and include targeted binary entry
internal/pipe/cask/templates/macos_packages.rb Insert conditional binary "{{ .Name }}", target: "{{ .Binary }}" for macOS packages
internal/pipe/cask/templates/linux_packages.rb Insert conditional binary "{{ .Name }}", target: "{{ .Binary }}" for Linux packages
internal/pipe/cask/templates/cask.rb Update default cask template to {{ with and (not .HasOnlyBinaryPkgs) .Binary }}
internal/pipe/cask/template.go Add HasOnlyBinaryPkgs to templateData; add Name & Binary to releasePackage
internal/pipe/cask/cask.go Populate pkg.Name/pkg.Binary, track formatCounts, and set HasOnlyBinaryPkgs
Comments suppressed due to low confidence (3)

internal/pipe/cask/cask.go:364

  • [nitpick] The variable formatCounts is ambiguous. Consider renaming it to artifactTypeCounts or typeCounts for clearer intent.
	formatCounts := map[artifact.Type]int{}

internal/pipe/cask/template.go:20

  • [nitpick] Please add doc comments for the new HasOnlyBinaryPkgs, Name, and Binary fields in templateData and releasePackage to clarify their purpose and usage.
	HasOnlyBinaryPkgs    bool

internal/pipe/cask/templates/cask.rb:11

  • The template references .Binary at the top level, but templateData has no Binary field. Either add a top-level Binary property to templateData or adjust this block to use the correct context.
  {{ with and (not .HasOnlyBinaryPkgs) .Binary }}

Comment thread internal/pipe/cask/cask.go
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.66%. Comparing base (8180429) to head (daf8937).
⚠️ Report is 912 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5840   +/-   ##
=======================================
  Coverage   82.66%   82.66%           
=======================================
  Files         164      164           
  Lines       16445    16451    +6     
=======================================
+ Hits        13594    13600    +6     
  Misses       2258     2258           
  Partials      593      593           

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

@caarlos0 caarlos0 merged commit 63c4755 into main Jun 17, 2025
17 checks passed
@caarlos0 caarlos0 deleted the binary-cask branch June 17, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants