-
Notifications
You must be signed in to change notification settings - Fork 10
Add jsonnet-format check and fix workflows #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add jsonnet-format check and fix workflows #273
Conversation
There was a problem hiding this 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 introduces jsonnet formatting workflows to the CI/CD pipeline, adding automated checking and fixing capabilities for Jsonnet configuration files. The implementation follows the established pattern of format check/fix workflows for other languages like CMake and Python.
Changes:
- Added
jsonnet-format-check.yamlworkflow to validate Jsonnet file formatting on PRs usingjsonnetfmt --test - Added
jsonnet-format-fix.yamlworkflow to automatically fix formatting issues via bot commands usingjsonnetfmt --in-place - Updated documentation to reflect the new jsonnet formatting capabilities in the bot commands
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 13 comments.
| File | Description |
|---|---|
.github/workflows/jsonnet-format-check.yaml |
New workflow to check Jsonnet formatting on pull requests using Docker-based jsonnetfmt |
.github/workflows/jsonnet-format-fix.yaml |
New workflow to automatically fix Jsonnet formatting via bot commands |
CLANG_TIDY_CONFIGURATION.md |
Updated format checks documentation to include Jsonnet |
.github/REUSABLE_WORKFLOWS.md |
Added documentation for jsonnet-format-fix workflow |
b08a117 to
4628033
Compare
|
@phlexbot jsonnet-format-fix |
|
@phlexbot format |
|
No automatic cmake-format fixes were necessary. |
|
No automatic clang-format fixes were necessary. |
8a3d7cb to
f43e051
Compare
9c7d7c0 to
b943485
Compare
This change introduces a new pair of workflows for checking and fixing the formatting of Jsonnet files (`.jsonnet` and `.jsonnet.in`). The `jsonnet-format-check.yaml` workflow runs on pull requests and manual dispatches, using `jsonnetfmt --test` to validate formatting. The `jsonnet-format-fix.yaml` workflow can be triggered manually or by commenting on a PR with `@phlexbot format` or `@phlexbot jsonnet-format-fix`. It uses `jsonnetfmt --in-place` to fix the files and commits the changes. Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com> Update workflow docs for `jsonnet-format` workflows
This commit resolves failures in `jsonnet-format-check.yaml` and `jsonnet-format-fix.yaml` by: 1. Switching to the `bitnami/jsonnet:latest` Docker image, as `google/jsonnet:latest` is no longer available on Docker Hub. 2. Running the `find` command inside the container context (via `sh -c`) to ensure that file paths passed to `jsonnetfmt` are correctly resolved relative to the container's working directory and volume mount. 3. Adding `--user "$(id -u):$(id -g)"` to the `docker run` commands to ensure consistent file ownership, which is particularly important for committing changes in the fix workflow. Fixes https://github.com/Framework-R-D/phlex/actions/runs/21464474107/job/61823562271?pr=273 Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
This commit updates the Jsonnet formatting workflows and the change
detection action to address Copilot review feedback and user requests:
1. **Change Detection**: Updated `detect-relevant-changes` action to
include a built-in `jsonnet` type (mapping to `*.jsonnet`), covering
both `.jsonnet` and `.jsonnet.in` files.
2. **Workflows**:
* Added `workflow_call` support to `jsonnet-format-check.yaml` and
`jsonnet-format-fix.yaml`.
* Implemented the `local_checkout_path` environment variable
pattern for consistent checkout handling.
* Switched to `container` job definitions using
`public.ecr.aws/bitnami/jsonnet:latest` instead of manual
`docker run` commands.
* Ensured dynamic bot command triggers in the fix workflow using
the repository name.
* Updated job conditions for consistency across all format-related
workflows.
3. **Action Annotations**: Ensured all non-local actions are annotated
with full version strings (e.g., `# vX.Y.Z`) instead of major
versions to support better Dependabot tracking.
4. **Documentation**: Updated `REUSABLE_WORKFLOWS.md` to fix duplicate
section numbering and ensure proper Markdown formatting (MD022).
These changes resolve the previous Docker image resolution issues and
bring the Jsonnet workflows in line with the project's established
reusable workflow patterns.
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
…n annotations
This commit comprehensively resolves issues in the Jsonnet formatting
workflows and brings the repository into compliance with requested
standards:
1. **Workflows Improvement**:
* Switched from manual `docker run` to `container` job level
definitions.
* Updated the image to `public.ecr.aws/bitnami/jsonnet:latest` to
resolve Docker Hub resolution issues.
* Added `workflow_call` support to `jsonnet-format-check.yaml` and
`jsonnet-format-fix.yaml`.
* Implemented the `local_checkout_path` environment variable
pattern for consistent directory handling.
* Updated job conditions for better consistency across all
formatting workflows.
* Ensured dynamic bot command triggers using the repository name.
2. **Action Improvements**:
* Updated `detect-relevant-changes` action to include a built-in
`jsonnet` type mapping to `*.jsonnet`.
* Verified and ensured that all non-local actions pinned by SHA
include full version annotations (e.g., `# vX.Y.Z`) to support
Dependabot tracking.
3. **Documentation**:
* Fixed duplicate section numbering and Markdown formatting
issues in `REUSABLE_WORKFLOWS.md`.
These changes ensure the Jsonnet workflows are robust, reusable, and
consistent with the project's established patterns.
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
- Add `workflow_call` support. - Use dynamic bot names (@<repo>bot) for comment triggers and error messages. - Enforce `author_association` check for `jsonnet-format-fix.yaml`. - Use absolute references for internal actions to support external callers. Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
b943485 to
8090442
Compare
- Align jsonnet-format-check.yaml and jsonnet-format-fix.yaml with other workflow pairs (e.g., CMake). - Add ref input to workflow_dispatch in jsonnet-format-check.yaml. - Refactor jsonnet-format-fix.yaml to support extra-repository workflow_call triggers by moving ref/repo logic to the pre-check job. - Update author association checks in fix workflows to use a robust list-based approach (OWNER, COLLABORATOR). - Align job and step names for consistency across the repository. - Fix bug in detect-relevant-changes action where jsonnet files were not correctly matched and improve the handling of types without .in variants. Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
knoepfel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please take a look at the Copilot comments and see if they're still relevant. If not, please resolve those conversations. Thanks.
- Align jsonnet-format-check.yaml and jsonnet-format-fix.yaml with other workflow pairs (e.g., CMake). - Add ref/repo inputs to workflow_call in jsonnet-format-check.yaml for extra-repository support. - Refactor jsonnet-format-fix.yaml to support extra-repository workflow_call triggers. - Implement trigger emulation in reusable workflows to automatically bypass relevance detection for manual/comment triggers. - Update author association checks in fix workflows (OWNER, COLLABORATOR). - Fix bug in detect-relevant-changes action where jsonnet files were not correctly matched. - Update REUSABLE_WORKFLOWS.md with detailed documentation for Jsonnet workflows and the trigger emulation pattern. Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
I have reviewed the remaining review comments and resolved them as I believve they have already been addressed. |
…-format-workflows
- Updated `REUSABLE_WORKFLOWS.md` for accuracy, clarity, and consistency.
- Replaced hardcoded SHAs with `<commit_sha>` placeholders.
- Standardized bot commands to use dynamic `@${{ github.event.repository.name }}bot`.
- Fixed fix-workflow usage examples to use a valid multi-job pattern.
- Clarified that Clang workflows are not currently reusable.
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
|
@phlexbot markdown-fix |
|
Automatic markdownlint fixes pushed (commit c881e83). |
This change introduces a new pair of workflows for checking and fixing the formatting of Jsonnet files (
.jsonnetand.jsonnet.in).The
jsonnet-format-check.yamlworkflow runs on pull requests and manual dispatches, usingjsonnetfmt --testto validate formatting.The
jsonnet-format-fix.yamlworkflow can be triggered manually or by commenting on a PR with@phlexbot formator@phlexbot jsonnet-format-fix. It usesjsonnetfmt --in-placeto fix the files and commits the changes.Co-authored-by: greenc-FNAL 2372949+greenc-FNAL@users.noreply.github.com
Update workflow docs for
jsonnet-formatworkflows