Skip to content
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

DEV-25: Error reporting on "dirty directory" failures #230

Merged
merged 13 commits into from
Nov 29, 2023

Conversation

jaymejohnson
Copy link
Contributor

@jaymejohnson jaymejohnson commented Oct 27, 2023

This PR adds extra output when a build fails due to a dirty artifact that lists the changed files.

To test: We will need to artificially create a dirty artifact scenario. Manually changing a composer.lock file to e.g. update
"plugin-api-version": "2.3.0" to "plugin-api-version": "2.6.0" did the job on the DHS project.

Testing steps

  1. In a project, checkout to a new testing branch that runs on circle.
  2. Run composer update palantirnet/the-build:dev-dev-25-dirty-artifact-reporting and commit it.
  3. Make a manual edit to composer.lock to trigger a dirty repo error.
  4. commit it in whatever manner the project requires in order to trigger the deploy step and the artifact build.

Note: When I was testing this initially I ran into an issue where it was never getting to the deploy step because circle would kill the build when the dirty repository checks were run in the step up step. If that happens, you can just comment out the lines in your project's .circleci/config.yml that are running the dirty repository checks.

  1. Once CircleCI runs the artifact build we expect a visible fail on the deploy step, as well as details in the test target output about what files were modified that caused the artifact to be not-safe-to-build. What you see should look something like this:
Screenshot 2023-11-16 at 6 29 50 PM

Link to example: https://app.circleci.com/pipelines/github/palantirnet/wisdhs-public/6655/workflows/72668daf-1094-4a61-bd7e-5d0723b5416f/jobs/16061

Copy link
Contributor

@byrond byrond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, @jaymejohnson! I viewed the CircleCI pipeline where this was tested, and the output looks good.

Once the spacing change on line 350 is reverted, this will be good to go!

targets/artifact.xml Outdated Show resolved Hide resolved
Copy link
Member

@becw becw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wahoo!

@becw becw merged commit 1960a28 into develop Nov 29, 2023
@becw becw deleted the dev-25-dirty-artifact-reporting branch November 29, 2023 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants