Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

surge-preview-tools: introduce a new domain-managed output #100

Closed
tbouffard opened this issue Dec 7, 2022 · 0 comments · Fixed by #106
Closed

surge-preview-tools: introduce a new domain-managed output #100

tbouffard opened this issue Dec 7, 2022 · 0 comments · Fixed by #106
Assignees
Labels
enhancement New feature or request

Comments

@tbouffard
Copy link
Member

tbouffard commented Dec 7, 2022

Currently, the domain-exist output has a wrong semantic. It states if the domain is managed by the surge token passed to the action whereas its name implicitly refers to the public availability of the domain
Quote from the ouput description in action.yml

false otherwise, in particular the domain was created with another login.

I suggest we introduce a new output for what the current domain-exist stores to clarify:

  • domain-managed
  • domain-managed-by-account
  • domain-managed-by-token
  • domain-managed-by-surge-account
  • domain-managed-by-surge-token

domain-exist would now state if the domain is publicly available.

The new output would be about what the surge token manages

  • true if the domain referenced by the preview-url exists and is managed by the surge account related to the surge-token.
  • false otherwise, in particular the domain was created with another surge account.

Would it be a breaking change?

Theoretically, yes, but in practice, this output is not used AFAIK. It is used internally in the action code to detect if the surge-action or surge CLI should be run and set the can-run-surge-command output. can-run-surge-command is the output that is actually used in workflows.

Interest for knowing if the domain exists i.e. is publicly available

Sometimes, the surge-preview action in charge of the actual deploy fails but the error is not detected by the workflow (even when setting the failOnError input) like in process-analytics/bpmn-visualization-R#128 (comment)
To verify that the deployment is up and was correctly done (at least for the initial one), users could run surge-preview-tools after surge-preview and fail the workflow if the domain-exist output is false.

Possible implementation

Do a simple fetch and check the status code.
Depending on how surge handles domains

  • If possible, use a HEAD request
  • Investigate if it must follow the redirects
@tbouffard tbouffard added the enhancement New feature or request label Dec 7, 2022
@tbouffard tbouffard changed the title surge-preview-tools: introduce a new domain-managed-by-surge-account output surge-preview-tools: introduce a new domain-managed output Dec 7, 2022
@tbouffard tbouffard self-assigned this Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant