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

Fail the build if the yarn.lock file is changed after running yarn install #949

Closed
gashcrumb opened this issue Feb 5, 2024 · 7 comments
Closed
Labels
jira Sync this issue with Jira kind/chore status/triage

Comments

@gashcrumb
Copy link
Member

What do you want to improve?

Often when running yarn install after updating the yarn.lock file contains changes.

What is the current behavior?

This is not ideal as it means there's inconsistencies between what folks are committing and what is being tested in github actions.

What will the new behavior be?

The build action will fail if there's changes to the yarn.lock file after running yarn install

See this comment for more information:

Yes this is a copy of janus-idp/backstage-plugins#1169

@nickboldt
Copy link
Member

nickboldt commented Apr 11, 2024

See https://issues.redhat.com//browse/RHIDP-1204 for updates.

PRs for this:

PR is failing already with

After 'yarn install', workspace is dirty! The following files have changed:

app-config.example.yaml
app-config.yaml
yarn.lock

-- https://github.com/janus-idp/backstage-showcase/actions/runs/8646895996/job/23707183425?pr=1174

and

After 'yarn install', workspace is dirty! The following files have changed:

app-config.example.yaml
app-config.yaml

-- https://github.com/janus-idp/backstage-showcase/actions/runs/8646912247/job/23707235821?pr=1175

Should we exclude app-config.* from the list of files that can be dirty during a release?

@gashcrumb
Copy link
Member Author

I think not to be honest. For me it's a red flag that there's something going on that needs to be investigated. Or it indicates that an upgrade has migrated the configuration files, in which case I think that this kind of change to the files should be required to be included in a PR update as well.

@nickboldt
Copy link
Member

so you're saying this is a GOOD and EXPECTED failure, and the change proposed by this PR is approved?

@gashcrumb
Copy link
Member Author

yep 😄

@gashcrumb
Copy link
Member Author

gashcrumb commented Apr 11, 2024

I take that back after looking at the PR action 😄 . Turns out the PR check build is copying the app config into place for some reason, so we should leave those two changed files as-is for now and just focus on the yarn.lock file.

@nickboldt
Copy link
Member

@nickboldt
Copy link
Member

nickboldt commented Apr 13, 2024

Woo! Snyk PRs are now failing with

After 'yarn install', workspace is dirty! The following files have changed:

app-config.example.yaml
app-config.yaml
yarn.lock

https://github.com/janus-idp/backstage-showcase/actions/runs/8661941105/job/23752905502?pr=1104

So... I'm going to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira Sync this issue with Jira kind/chore status/triage
Projects
None yet
Development

No branches or pull requests

2 participants