argocd-commenter
argocd-commenter copied to clipboard
Deployment URL cannot be parsed for GitHub Enterprise
Problem
The deployment URL for GitHub Enterprise cannot be parsed. As a result, ParseDeploymentURL
in pkg/github/deployment.go
will always return nil
and deployment statuses in GitHub will never be updated when phases change.
https://github.com/int128/argocd-commenter/blob/b7c76020fdd7acb54c2750090b0365e079815a6d/pkg/github/deployment.go#L17-L25
As an example, our GitHub Enterprise URL https://api.github.some-company.com/repos/IOTA/repo/deployments/54392
will never match the regex.
This also does not seem to be the only place the issue occurs. In pkg/github/types.go
there are also some hardcoded regexes for the public github.com.
https://github.com/int128/argocd-commenter/blob/b7c76020fdd7acb54c2750090b0365e079815a6d/pkg/github/types.go#L23-L26
Edit
I just discovered that the issue also occurs in https://github.com/int128/oauth2-github-app. The config.go
file also has the hardcoded public github.com URL.
Solution
Can the regex either be made less strict on the hostname, or be constructed using the GITHUB_ENTERPRISE_URL
from the secret?
Thank you for bringing up the issue. I will fix the implementation for GitHub Enterprise Server.
@jensvandenreyt Can you check https://github.com/int128/argocd-commenter/pull/878? Let me clarify if it meets the requirement because I don't have an environment of GitHub Enterprise Server.