CI: Cache the packages/ directory (fixes broken language-rust-bundled test)#21884
CI: Cache the packages/ directory (fixes broken language-rust-bundled test)#21884sadick254 merged 1 commit intoatom:masterfrom
language-rust-bundled test)#21884Conversation
Ensures we do not miss restoring these packages' node_modules folders when running the post-build jobs (the test jobs in particular).
|
@sadick254 this PR should prevent the kind of CI failures seen with Please take a look if you have time. |
sadick254
left a comment
There was a problem hiding this comment.
Thank you for looking into this @DeeDeeG. Caching the packages folder is a better approach.
We could ignore the error for now. I would highly appreciate a follow-up PR to resolve the error.
##[warning]The given cache key has changed in its resolved value between restore and save steps;
|
[ Edit from the future: This was fixed by #21887 ] Trying to get rid of those I tried to figure out exactly what files are changing, but I could not locally reproduce the files changing after running tests... (I bootstrapped the repository. Then did The most technically precise thing to do would be to individually cache the |
Ensures we do not miss restoring these packages'
node_modulesfolders when running the test jobs.Requirements for Contributing a Bug Fix (from template, click to expand):
Identify the Bug
Fixes an overlooked edge case pertaining to the
Cache@2CI task upgrade (#21057).See discussion in #21790.
Due to the way
npminstalls packages that are specified as local paths (./some/path), and how caching was set up in Atom's CI, it was possible for Atom's CI to miss (fail to cache and restore) some packages' sub-dependencies. This could cause their tests to fail.Description of the Change
In CI, start caching the
packages/directory. This ensures that those packages'node_modulesfolders (the packages' dependencies) are always restored in the post-build jobs. This is particularly relevant for ensuring the test jobs will pass.Alternate Designs
We could simply work around this infrequent issue by carefully hoisting dependencies. For example, this commit would solve the recent issue for the
language-rust-bundledpackage: DeeDeeG@ab7c3b5As an implementation detail, we could more easily specify these caches if using the older Lighthouse/Microsoft DevLabs caching tool: https://marketplace.visualstudio.com/items?itemName=1ESLighthouseEng.PipelineArtifactCaching
Possible Drawbacks
Adds about four or five seconds to each CI job.
Also, there will be some "warnings" about caches changing in the
macOS Tests packages-2job:These warnings are expected and can be safely ignored, but they add noise to the CI runs. If I figure out exactly which files change (probably some test fixtures or temp test output?) I might be able to filter those out in the cache ID.
(As mentioned in "Alternative Designs", these warnings could be avoided with the old Lighthouse/Microsoft DevLabs cache task, but that task is unofficial and not supported anymore.)
Verification Process
Ran CI with "Enable system diagnostics" checked. The right files are now cached and restored, including the
packages/folder. See: CI linkRelease Notes
N/A