-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Before Opening Please...
- Search for an existing/duplicate RRFC which might be relevant to your RRFC
There is one RFC about logging: using STDERR for errors instead of STDOUT. This is unrelated.
Motivation ("The Why")
Currently some CI providers, specifically GitLab, restrict job artifacts to being relative to the repository. Presumably, this stops you from uploading runner files that may have dirty-state left from previous runs in non-containerized workflows. Specifically the GitLab documents say,
The
pathskeyword determines which files to add to the job artifacts. All paths to files and directories are relative to the repository where the job was created.
This effectively means NPM logs on error can not be captured as job artifacts.
Example
How
Current Behaviour
What I would like to do is something like this (ignore the actual error)
$ npx ng e2e
npm ERR! could not determine executable to run
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-11-22T17_24_50_085Z-debug.lo
Then I want to upload /root/.npm/_logs/2021-11-22T17_24_50_085Z-debug.log as a job artifact.
This is not currently possible
Desired Behaviour
In light of GitLab not permitting global files to be uploaded as job artifacts I would like an option to set the log file,
npx [--log <LOCATION>] ng e2eSuch that LOCATION could be relative to the cwd.
Then I could do,
$ npx --log "./.npm/_logs/" ng e2e
And set ./.npm/_logs/* as my artifacts to upload to GitLab.
References
- npm-debug.log could be written to /tmp or similar npm#1548
- Make npm-debug.log path configurable. npm#5252
- Put npm-debug.log file in the cache folder, not cwd npm#6744 (exact comment that explains this issue's importance to CI: I am not alone)
- https://stackoverflow.com/questions/21624030/change-npm-debug-log-location/23456148