Open
Conversation
This hook validates that pipeline steps in melange YAML files don't have only a 'name' field without 'uses' or other details. This catches a common mistake where 'name' is used instead of 'uses' for pipeline steps. The check covers: - Main pipeline steps - Test pipeline steps - Subpackage pipeline steps - Subpackage test pipeline steps Includes test data files demonstrating both valid and invalid configurations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
dannf
reviewed
Aug 13, 2025
| yaml = ruamel.yaml.YAML(typ="safe") | ||
|
|
||
|
|
||
| def check_pipeline_steps(melange_cfg: dict[str, Any]) -> tuple[bool, list[str]]: |
Contributor
There was a problem hiding this comment.
melange requires that the main package has a pipeline, so I have created packages with name-only steps. See cuda-stub-meta.yaml in extra-packages as an example. That's likely a melange bug of course, but it's reality today.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
check-pipeline-name-only-stepsthat validates pipeline step formatting in melange YAML filesname:is used instead ofuses:for pipeline steps (e.g.,- name: test/go-fips-checkinstead of- uses: test/go-fips-check)What it checks
The hook validates that pipeline steps don't have only a
namefield withoutusesor other details. It checks:Example of issues it catches
Test plan
test-data/directory with examples of both valid and invalid configurationspre-commit try-repoagainst both good and bad YAML files🤖 Generated with Claude Code