Skip to content

Conversation

@greenc-FNAL
Copy link
Contributor

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

Copy link
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 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.yaml workflow to validate Jsonnet file formatting on PRs using jsonnetfmt --test
  • Added jsonnet-format-fix.yaml workflow to automatically fix formatting issues via bot commands using jsonnetfmt --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

@greenc-FNAL greenc-FNAL changed the title Add jsonnet-format check and fix workflows [WIP] Add jsonnet-format check and fix workflows Jan 29, 2026
@greenc-FNAL greenc-FNAL force-pushed the maintenance/jsonnet-format-workflows branch 11 times, most recently from b08a117 to 4628033 Compare January 30, 2026 18:33
@greenc-FNAL
Copy link
Contributor Author

@phlexbot jsonnet-format-fix

@greenc-FNAL
Copy link
Contributor Author

@phlexbot format

@github-actions
Copy link
Contributor

No automatic cmake-format fixes were necessary.

@github-actions
Copy link
Contributor

No automatic clang-format fixes were necessary.

@greenc-FNAL greenc-FNAL force-pushed the maintenance/jsonnet-format-workflows branch from 8a3d7cb to f43e051 Compare January 30, 2026 20:50
@greenc-FNAL greenc-FNAL changed the title [WIP] Add jsonnet-format check and fix workflows Add jsonnet-format check and fix workflows Jan 30, 2026
@greenc-FNAL greenc-FNAL force-pushed the maintenance/jsonnet-format-workflows branch 2 times, most recently from 9c7d7c0 to b943485 Compare January 30, 2026 23:38
google-labs-jules bot and others added 4 commits February 2, 2026 11:11
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>
greenc-FNAL and others added 5 commits February 2, 2026 11:11
- 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>
@greenc-FNAL greenc-FNAL force-pushed the maintenance/jsonnet-format-workflows branch from b943485 to 8090442 Compare February 2, 2026 17:11
- 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
knoepfel previously approved these changes Feb 2, 2026
Copy link
Member

@knoepfel knoepfel left a 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>
@greenc-FNAL
Copy link
Contributor Author

LGTM. Please take a look at the Copilot comments and see if they're still relevant. If not, please resolve those conversations. Thanks.

I have reviewed the remaining review comments and resolved them as I believve they have already been addressed.

knoepfel
knoepfel previously approved these changes Feb 2, 2026
- 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>
knoepfel
knoepfel previously approved these changes Feb 2, 2026
@greenc-FNAL
Copy link
Contributor Author

@phlexbot markdown-fix

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

Automatic markdownlint fixes pushed (commit c881e83).
⚠️ Note: Some issues may require manual review and fixing.

@greenc-FNAL greenc-FNAL merged commit 35626f2 into Framework-R-D:main Feb 2, 2026
37 of 40 checks passed
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.

3 participants