mi6 / mi6/ic-ui-kit

Update Cypress images for external contributors

Open
#3,783 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

### Summary
At the moment if a Cypress image needs updating in an external contributor's PR we've been asking them to skip the test and then we update the images afterwards. It would be good if we could have the updated images in the original PR in case any of the code is breaking anything.

### 💬 Description
I'm wondering if we could add something to the Cypress step in the branches workflow e.g.
- Test whether the compare branch is from a forked repo
- Check if any of the Cypress images are missing
- Add the missing images in like we do in the update cypress visual regression images workflow

This way if any of the tests were failing, we could just ask the external contributor to remove the image and it would get added back correctly by this step in the workflow.

### 💰 Use value
It would be less work for us when an external contributor makes a change. It would also be less off putting for a contributor if the full workflow worked for them.

### 🚨 Urgency (low, medium or high)
Medium - we don't get too many external contributions where this is an issue, but it would be a problem if we started to get more.

### Additional information

Looks like there's env variables to use to check if it's a fork e.g.

```
- name: Check if repo is a fork
run: |
if [ "${GITHUB_REPOSITORY}" != "${GITHUB_BASE_REPOSITORY}" ]; then
echo "from_fork=true" >> $GITHUB_OUTPUT
else
echo "from_fork=false" >> $GITHUB_OUTPUT
fi
id: check_fork
```

Contributor guide

Open the contributing guide

Research direction

Start with the Cypress step in the branches workflow and compare it with the update cypress visual regression images workflow. Check how fork status and missing Cypress images can be detected using the provided repository environment variables. Done means external contributor PRs can restore missing images while still running the relevant visual regression checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, github-actions
Domain
ci-cd, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.