build(cypress)!: revise Cypress base URL value for staging scenario #363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR changes the value assigned to
cypressEnv.CYPRESS_BASE_URL
in the staging scenario so that the the environment variable contains the entire URL rather than just the hostname.The rationale is that this will require a new key type added to cp-vault-interface for
heroku-url
(done in this PR). The otherxxxxx-url
validators in cp-vault-interface (currently onlyraven-url
andslack-webhook-url
) use the URL validator.From a consistency perspective it would make sense that all URL values in Vault are the full URL rather than just the hostname.
We can also validate a) that the value is a URL, b) that its protocol is
https:
, and c) its format matches the Heroku hostname format, as long as the value is updated using cp-vault-interface rather than manually, though admittedly this is dependent on individuals and therefore not a guarantee while the hardcodedhttps:
in the Cypress plugin's existing state does enforce the protocol, so there is certainly an argument as to whether this is the best approach (both here and more generally).I have added @Financial-Times/cp-reliability as reviewers to this PR as I think it feeds into this larger discussion of secret management.
Naming change for the environment variable
I changed the name from
CY_
toCYPRESS_
so as to make explicit the purpose of the environment variable as those less familiar with Cypress may not be aware of itscy
usage shorthand.Semver release decision
I have used a
!
in the commit to indicate a breaking change. While I don't think there are any apps that have yet migrated to Tool Kit and are running end-to-end Cypress tests against the staging app in their CircleCI production deployment pipeline, I'm not certain this is definitely the case and so in the interests of caution it should be a major release as thetool-kit/e2e-test-staging
job will fail at Run smoke tests on staging without the necessary environment variable amends.Checklist:
feat(circleci): add support for nightly workflows
,fix: set Heroku app name for staging apps too