Open mcollina opened 3 weeks ago
Can you clarify what's "dynamic" about it? Note that you need to provide NOCK_ENV=replay
env variable, otherwise the nock DB is ignored.
Maybe I don't understand the source code exactly, but https://github.com/nodejs/corepack/blob/main/.github/workflows/update-nock-files.yml updates it in a PR id passed through. Maybe dynamic is not the right term, but I found this quite hard to reason about.
Why would you need this step?
If we remove it, it’s only going to make the CI more flaky – because tests would rely on network calls instead of the FS. The only thing dynamic about it is that changes in Corepack internals can result in different endpoint being hit, at which point the nock db needs to be updated to cover those new endpoints.
Why do we need the workflow: I use it because I find it simpler to use it than to pull the PR branch locally and update the nock DB manually.
Having a "nock" database makes this codebase harder to reason about due to the "dynamic" nature of this mocking.
Can this be refactored out?