This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
CI: Cache the packages/ directory (fixes broken language-rust-bundled
test)
#21884
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ensures we do not miss restoring these packages'
node_modules
folders 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@2
CI task upgrade (#21057).See discussion in #21790.
Due to the way
npm
installs 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_modules
folders (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-bundled
package: 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-2
job: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