Re-run of passing / accepted build failed through Chromatic Github action
See original GitHub issueWe are running Chromatic as part of a multi-step github workflow, which due to a slightly flaky test occasionally fails at a later step in the process. If this happens, we simply re-run the github action, which re-runs the chromatic action as part of that. If the chromatic build has already been accepted, it fails with the following error:
Run chromaui/action@v1
with:
token: ***
projectToken: ***
workingDir: modules/frontend
exitOnceUploaded: true
preserveMissing: true
env:
MONGOMS_SYSTEM_BINARY: /usr/bin/mongod
PUPPETEER_DOWNLOAD_PATH: /home/ec2-user/.local-chromium
Chromatic CLI v6.3.3
https://www.chromatic.com/docs/cli
Authenticating with Chromatic
→ Connecting to https://index.chromatic.com
Authenticated with Chromatic
→ Using project token '********c0bf'
Retrieving git information
Could not retrieve package info from registry; skipping update check
Skipping build
→ Skipping rebuild of an already fully passed/accepted build
Error: Cannot read property 'toString' of undefined
Error: TypeError: Cannot read property 'toString' of undefined
at /home/ec2-user/actions-runner/_work/_actions/chromaui/action/v1/action/main.js:350:1612938
at /home/ec2-user/actions-runner/_work/_actions/chromaui/action/v1/action/main.js:350:1608861
at Object.next (/home/ec2-user/actions-runner/_work/_actions/chromaui/action/v1/action/main.js:350:1608966)
at o (/home/ec2-user/actions-runner/_work/_actions/chromaui/action/v1/action/main.js:350:1607680)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Cannot read property 'toString' of undefined
This is being thrown at https://github.com/chromaui/chromatic-cli/blob/524e18aca82d58d6fc6f60151783d2ef9a9215a7/action-src/main.ts#L192
I believe this is due to the exit code not being set before the return
on https://github.com/chromaui/chromatic-cli/blob/524e18aca82d58d6fc6f60151783d2ef9a9215a7/bin-src/tasks/gitInfo.js#L91
so I have opened #492 which, if I have worked out the cause correctly, will fix it. I don’t know how run the actions script locally and I couldn’t spot any tests you had which verified the exit code, so I have made no changes there.
Side note - why does this check (not re-running on the same commit) only skip if the build is passed or accepted? If the commit is identical, should the build not be identical and therefore always skipped?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:12 (3 by maintainers)
Top GitHub Comments
Fixed in 6.3.4.
+1 … we are seeing similar problems and are blocked by this ‘toString’ undefined issues as well … searching for solutions, hoping @RobertStanyon’s PR resolves this (anxiously awaiting the merge). Please update if anyone resolves this another way or has ideas