uffizzi
uffizzi copied to clipboard
Add pull request number to URL when preview is triggered via GHA
If Uffizzi has been configured from our UI, then deployments that are triggered by pull requests are of the format:
https://pr-<issue-number>.foo.bar.app.uffizzi.com
However, if the user has configured Uffizzi via GitHub Actions, then deployments that are triggered by pull requests are of the format:
https://foo.bar.app.uffizzi.com
We should make these formats consistent. Add the PR number to the URL when previews are triggered from GitHub Actions.
To test: Use the CLI version from branch feature/136_metadata_for_previews. Run preview creation with GitHub labels.
uffizzi preview create --set-labels="github.pull_request.number=<NUMBER> github.repository=<ORGANIZATION_NAME/REPOSITORY_NAME>"
- [x] 1. Create a preview without a label and pull request number
- [x] 2. Create a preview with label and pull request number
- [x] 3. Check parse of GitHub repository name (Name may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen). Check if the name with this condition parses well.
- [x] 4. Create a preview without a label and pull request number and update this preview without a label and pull request number (URL should not be updated)
- [x] 5. Create a preview without a label and pull request number and update this preview with a label and pull request number (URL should not be updated)
- [x] 6. Create a preview with a label and pull request number and update this preview with a label and pull request number (URL should not be updated)
tested.
Steps:
1.send a command with only one of the values.
(either with pull_request.number / or github.repository),
Actual result:
- the console displays the error "undefined method `[]' for nil:NilClass" .
- starts a preview run with infinite loader.
Expected result: return error to be readable format.
P.S. maybe in this case, the preview should not be started.
(it will not be created).
Tested. OK. Preview is created, errors removed.
TESTED on prod - OK.