Automattic / Automattic/nvm-buildkite-plugin

`nvm_installation_dir` mutated outside of job

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

As part of the `pre-exit` hook, the `nvm_installation_dir` is [fetched from the BuildKite agent key/value store](https://github.com/Automattic/nvm-buildkite-plugin/blob/561d5d72bbb89b826f2f4083e20084f6b89542a3/hooks/pre-exit#L5).

If I understand [the docs](https://buildkite.com/docs/agent/v3/cli-meta-data) correctly, this store is global to all agents. This means that jobs could mutate `nvm_installation_dir` and [affect other jobs](https://github.com/Automattic/nvm-buildkite-plugin/blob/561d5d72bbb89b826f2f4083e20084f6b89542a3/hooks/pre-exit#L7).

Example:
- [Job A](https://buildkite.com/automattic/gutenberg-mobile/builds/7737#018b8668-77a8-49f4-bf9b-f3136375d1b4) generated `w6i8GGXW`
- [Job B](https://buildkite.com/automattic/gutenberg-mobile/builds/7737#018b8668-70f4-4266-a828-2e43853d64bf) generated `riEsqXM4`
- [Job A](https://buildkite.com/automattic/gutenberg-mobile/builds/7737#018b8668-77a8-49f4-bf9b-f3136375d1b4) looked for `riEsqXM4` at cleanup, when we would expect it to use `w6i8GGXW`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading hooks/pre-exit and the linked Buildkite metadata documentation to verify how nvm_installation_dir is stored and retrieved. Trace the cleanup path for concurrent jobs, then confirm that each job uses its own installation directory without affecting another job's metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, shell
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.