Skip to content

Added: artifact-name-exclude-features parameter for selective feature filtering#16

Merged
Sewer56 merged 1 commit intov1-masterfrom
add-artifact-name-exclude-features
Dec 3, 2025
Merged

Added: artifact-name-exclude-features parameter for selective feature filtering#16
Sewer56 merged 1 commit intov1-masterfrom
add-artifact-name-exclude-features

Conversation

@Sewer56
Copy link
Member

@Sewer56 Sewer56 commented Dec 2, 2025

  • Add artifact-name-exclude-features input to action.yml (defaults to 'c-exports')
  • Implement filter_features() function in get-artifact-name.sh for exact-match filtering
  • Add comprehensive test suite with 6 scenarios covering edge cases
  • Document feature usage and behavior in README.MD

Summary by CodeRabbit

  • New Features

    • Added artifact-name-exclude-features input to exclude specified features from artifact names while building them. Defaults to excluding "c-exports".
  • Documentation

    • Updated with examples and detailed guidance on the new feature exclusion option.
  • Tests

    • Added comprehensive test suite covering feature exclusion scenarios including partial exclusion, empty lists, whitespace trimming, and exact-match behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

… filtering

- Add artifact-name-exclude-features input to action.yml (defaults to 'c-exports')
- Implement filter_features() function in get-artifact-name.sh for exact-match filtering
- Add comprehensive test suite with 6 scenarios covering edge cases
- Document feature usage and behavior in README.MD
@coderabbitai
Copy link

coderabbitai bot commented Dec 2, 2025

Walkthrough

The pull request introduces feature exclusion support for Rust artifact naming across the GitHub Action. It adds a new artifact-name-exclude-features input to the action, updates the artifact name generation script with a filter function, documents the new behavior, and includes comprehensive workflow tests to verify the exclusion logic.

Changes

Cohort / File(s) Summary
Artifact naming script
scripts/get-artifact-name.sh
Adds --exclude-features command-line option and filter_features() function to parse and trim exclusion lists, removing specified features from artifact name generation while still building them.
Action configuration
action.yml
Introduces artifact-name-exclude-features input with default value "c-exports", and updates artifact name generation for all types (binary, binary-symbols, library, library-symbols) to use the new parameter.
Documentation
README.MD
Adds description of the new artifact-name-exclude-features input with default behavior and includes a new subsection explaining feature exclusion with examples.
Workflow tests
.github/workflows/test-artifact-names.yml
Introduces new test-artifact-name-exclude-features job with test cases covering partial exclusion, full exclusion, whitespace trimming, empty exclusion lists, exact-match behavior, and action.yml integration patterns.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Filter function logic: Review the filter_features() implementation for correct parsing, trimming, deduplication, and filtering behavior.
  • Script integration: Verify that the excluded features are properly applied before artifact name suffix generation and that empty exclusion results in all features being included.
  • Action.yml integration: Confirm the new input is correctly passed through all artifact type generation calls.
  • Test coverage: Validate that test cases comprehensively cover edge cases (whitespace, empty lists, exact matching).

Possibly related PRs

  • Added: Artifact prefix support #15: Modifies artifact name generation logic in the same files (action.yml and scripts/get-artifact-name.sh), adding artifact-prefix handling alongside feature exclusion.

Poem

🐰 Features dancing in the name,
Now we pick and choose the game,
Exclude what's not needed there,
Names grow lean with careful care,
Rabbit hops through cleaner schemes! 🎯

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 accurately summarizes the main change: adding a new artifact-name-exclude-features parameter for feature filtering, which aligns with the changeset across action.yml, get-artifact-name.sh, README.MD, and the test workflow.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-artifact-name-exclude-features

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44a42d6 and f92c5f2.

📒 Files selected for processing (4)
  • .github/workflows/test-artifact-names.yml (1 hunks)
  • README.MD (2 hunks)
  • action.yml (2 hunks)
  • scripts/get-artifact-name.sh (4 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/test-artifact-names.yml

[warning] 317-433: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
  • GitHub Check: test-artifact-names (false, armv7-unknown-linux-gnueabihf, armv7-unknown-linux-gnueabihf, armv7-u...
  • GitHub Check: test-artifact-names (false, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu, aarch64-unknown...
  • GitHub Check: test-specific-nightly
  • GitHub Check: test-workspace-build-2
  • GitHub Check: test-custom-rustflags
  • GitHub Check: test-workspace-build
  • GitHub Check: test-library-pgo
  • GitHub Check: test-binary-pgo-with-library
  • GitHub Check: test-binary-bundled (windows-latest, x86_64-pc-windows-msvc)
  • GitHub Check: test-library-bundled (windows-latest, x86_64-pc-windows-msvc)
  • GitHub Check: test-build-without-native-host-tools
  • GitHub Check: test-binary-separate (macos-latest, aarch64-apple-darwin)
  • GitHub Check: test-library-separate (windows-latest, x86_64-pc-windows-msvc)
  • GitHub Check: test-pgo-with-cross-compile
  • GitHub Check: test-library-separate (macos-latest, aarch64-apple-darwin)
  • GitHub Check: test-binary-separate (windows-latest, x86_64-pc-windows-msvc)
🔇 Additional comments (5)
scripts/get-artifact-name.sh (1)

85-123: ✓ Sound filter_features implementation with proper edge-case handling.

The function correctly implements exact-match filtering with whitespace trimming. Associative arrays (bash 4+) are appropriate for O(1) lookups. Early returns for empty inputs and proper quoting throughout maintain clarity and robustness.

README.MD (1)

300-313: ✓ Clear and accurate documentation of feature exclusion behavior.

The examples correctly reflect the implementation (exact-match filtering, whitespace handling, empty list behavior). Default value rationale is well-explained.

action.yml (2)

111-114: ✓ Input parameter properly defined and positioned.

Clear description, appropriate default value, and correct placement within the Artifact & Output Settings section.


267-270: ✓ Consistent parameter passing across all artifact types.

All four artifact type calls (binary, binary-symbols, library, library-symbols) receive the exclude-features parameter with proper quoting.

.github/workflows/test-artifact-names.yml (1)

315-433: ✓ Comprehensive test coverage for feature exclusion scenarios.

The six test cases systematically cover partial exclusion, complete exclusion, whitespace handling, empty exclude lists, exact-match behavior, and action.yml integration patterns. Test structure is clear and assertions are appropriate.

@Sewer56 Sewer56 merged commit 2499a60 into v1-master Dec 3, 2025
48 checks passed
@Sewer56 Sewer56 deleted the add-artifact-name-exclude-features branch December 3, 2025 01:56
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