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

Run diff-check on JS/CSS to catch updates #2680

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

nickcharlton
Copy link
Member

In #2673, we discussed catching changes in the builds directory as being quite annoying in development. This can happen when people contribute changes (and should probably also commit their build changes to make future development easier), plus also when dependencies change.

Catching this with diff-check should mean that we see this at the point of introduction, rather than later on.

@nickcharlton
Copy link
Member Author

I do feel like it's not very clear what you should do with that failure, maybe it needs a custom message or something to make it clearer.

@littleforest
Copy link
Contributor

Is there any reason not to just add the build files to .gitignore as suggested by @goosys #2673 (comment)

@pablobm
Copy link
Collaborator

pablobm commented Oct 19, 2024

Just to confirm: this is intended to force contributors to check in any changes to compiled assets, right? In which case, it gets my vote, unless I'm missing a use case somewhere 🙂

@littleforest - The issue I'm seeing is that any assets missing from the repo are not available when pulling the gem from Git (eg: gem "administrate", git: ....

@nickcharlton
Copy link
Member Author

this is intended to force contributors to check in any changes to compiled assets

Yeah, that's my thinking. If you make changes, your build will fail and prompt you to run the build.

A little while after I did this, it occurred to me that it solves another problem quite nicely, too: it stops us from having to make sure the prerelease Administrate demo is compiled correctly.

On this though, next I'd like to make sure it's got a better suggestion of what to do. Then once we've cut a new release we can merge this in.

@nickcharlton nickcharlton force-pushed the nc-run-diff-check-over-builds branch 2 times, most recently from 03dbbd8 to afabe04 Compare October 25, 2024 13:49
@nickcharlton nickcharlton force-pushed the nc-run-diff-check-over-builds branch from afabe04 to e28bb92 Compare November 8, 2024 10:08
@nickcharlton nickcharlton added this to the v1.0.0 milestone Nov 19, 2024
@nickcharlton nickcharlton force-pushed the nc-run-diff-check-over-builds branch from e28bb92 to 4234c58 Compare November 19, 2024 11:06
nickcharlton added a commit that referenced this pull request Nov 19, 2024
`npm`/`yarn` is non-deterministic when it comes to dependencies, and so
you can very easily end up with a dependency drift (especially when
you're being strict about what you build).

It turns out that this is what #2680 was showing. If we clean the whole
environment (`git clean -fdx`), then run `setup` and the other steps
that the Action runs through, we get the same result.
@nickcharlton nickcharlton force-pushed the nc-run-diff-check-over-builds branch from a911854 to 94443c2 Compare November 19, 2024 11:37
nickcharlton added a commit that referenced this pull request Nov 19, 2024
`npm`/`yarn` is non-deterministic when it comes to bundling
dependencies, and so you can very easily end up with a dependency drift
(especially when you're being strict about what you build elsewhere).

It turns out that this is what #2680 was showing. If we clean the whole
environment (`git clean -fdx`), then run `setup` and the other steps
that the Action runs through, we get the same result.
nickcharlton added a commit that referenced this pull request Nov 19, 2024
`npm`/`yarn` is non-deterministic when it comes to bundling
dependencies, and so you can very easily end up with a dependency drift
(especially when you're being strict about what you build elsewhere).

It turns out that this is what #2680 was showing. If we clean the whole
environment (`git clean -fdx`), then run `setup` and the other steps
that the Action runs through, we get the same result.
In #2673, we discussed catching changes in the `builds` directory as
being quite annoying in development. This can happen when people
contribute changes (and should probably also commit their build changes
to make future development easier), plus also when dependencies change.

Catching this with `diff-check` should mean that we see this at the
point of introduction, rather than later on.
@nickcharlton nickcharlton force-pushed the nc-run-diff-check-over-builds branch from 94443c2 to a101982 Compare November 19, 2024 11:42
@nickcharlton
Copy link
Member Author

I figured out why this kept failing, but I couldn't locally and just merged in #2710. It was a tiny change by JS bundling standards, and caused by how npm actually works (badly…).

Anyway, the solution is to do something like this:

git clean -fdx
bin/setup
yarn install
yarn build
yarn build:css

diff-check doesn't actually have a way to prompt what to do yet. I'd like to add that, but I'd also like to merge this sooner than later, so I'm going to do that.

@nickcharlton nickcharlton merged commit d504990 into main Nov 19, 2024
21 checks passed
@nickcharlton nickcharlton deleted the nc-run-diff-check-over-builds branch November 19, 2024 11:52
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