Before Opening Please...
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 paths keyword 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 e2e
Such 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
Before Opening Please...
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,
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)
Then I want to upload
/root/.npm/_logs/2021-11-22T17_24_50_085Z-debug.logas 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,
Such that
LOCATIONcould be relative to the cwd.Then I could do,
And set
./.npm/_logs/*as my artifacts to upload to GitLab.References