uffizzi icon indicating copy to clipboard operation
uffizzi copied to clipboard

Add pull request number to URL when preview is triggered via GHA

Open gadkins opened this issue 2 years ago • 5 comments

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.

gadkins avatar Aug 04 '22 20:08 gadkins

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>"

antlu avatar Aug 19 '22 08:08 antlu

  • [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)

NealArw avatar Aug 22 '22 10:08 NealArw

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).

image

fedorov-dualboot avatar Aug 22 '22 22:08 fedorov-dualboot

Tested. OK. Preview is created, errors removed. 2022-08-23_16-07-18

fedorov-dualboot avatar Aug 23 '22 13:08 fedorov-dualboot

TESTED on prod - OK.
image

fedorov-dualboot avatar Aug 29 '22 12:08 fedorov-dualboot