Skip to content

Add linting to single-repo CI builds#16

Merged
andrewmogan merged 30 commits into
developfrom
amogan/single_package_linting
Apr 2, 2026
Merged

Add linting to single-repo CI builds#16
andrewmogan merged 30 commits into
developfrom
amogan/single_package_linting

Conversation

@andrewmogan
Copy link
Copy Markdown
Contributor

This PR enables the single-repo CI builds to run dbt-build --lint. This is largely modeled off Eric's implementation in artdaq. The idea is to catch new linting errors introduced by pull requests without raising all previous linting errors (there are a lot in most repos). The nightly CI build will now upload an artifact called nightly_linting_results. Builds triggered by pull requests will upload pull_request_linting_results and then compare this to the most recent nightly_linting_results. If the diff (or, to be more precise, comm -13) between the two is non-empty, the workflow will raise an error and upload linting_diff as an artifact.

Notable changes:

  • Add caller_event_name as a required input. This is necessary to distinguish scheduled (nightly) builds from those triggered by pull requests. Note that this means I'll need to sync the workflow files in each repository after this PR is merged.
  • Use cvmfs-contrib/github-action-cvmfs to access CVMFS and, by extension, llvm.
  • Write a build_and_lint_package.sh script and run it in the appropriate container.
  • Use sed magic to simplify linting output for a clean diff.

For tests, see this example triggered by dummy pull request #136 in hdf5libs. For comparison, here is a scheduled test which mocks the nightly workflow, but uses this feature branch to include linting.

@jcfreeman2
Copy link
Copy Markdown
Contributor

Could we also update the workflow-templates/dunedaq-develop-cpp-ci.yml file in this PR to provide caller_event_name? It would be consistent with the changes in .github/workflows/dunedaq-develop-cpp-ci.yml and make testing easier.

@jcfreeman2
Copy link
Copy Markdown
Contributor

Thanks for the caller_event_name; however a new issue's popped up. I created a prep-release/fddaq-v5.6.0 branch in cmdlib which is just an alias of develop, then forked a johnfreeman/do_not_merge branch where I (1) wrote a little bit of noncompliant code and (2) updated the Workflow to use the amogan/single_package_linting branch of .github and not develop, as well as passing it the called_event_name argument.

When I opened the PR, the resulting Action was https://github.com/DUNE-DAQ/cmdlib/actions/runs/23862915154. However, in the compare_linting_results job section of the Action, I got the following, and I'm not sure what's happening:

Error: Unable to download artifact(s): Not Found - https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts

@andrewmogan
Copy link
Copy Markdown
Contributor Author

In order to test in an individual repo after merging, I've added a workflow_dispatch trigger to the single-repo CI which includes the caller_event_name field as an input. If left as schedule, the workflow will run up to dbt-build --lint and upload the results as nightly_linting_diff. If pull_request (or, technically, if anything other than schedule) is specified, the comparison the most recent "nightly" results will run.

@andrewmogan andrewmogan merged commit cf5efb1 into develop Apr 2, 2026
@andrewmogan andrewmogan deleted the amogan/single_package_linting branch April 2, 2026 19:06
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.

2 participants