docs: clarify release deployment process and enable manual deploy trigger

- Add workflow_dispatch to deploy.yml for manual deployment triggers
- Document that releases don't auto-deploy to production
- Add instructions for deploying releases to production
- Add verification steps for deployment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
tadasant 2025-09-29 18:54:56 -07:00
commit c40374c280
4 changed files with 134 additions and 112 deletions

View file

@ -36,4 +36,4 @@ type RepositorySource string
const (
SourceGitHub RepositorySource = "github"
SourceGitLab RepositorySource = "gitlab"
)
)

View file

@ -35,7 +35,7 @@ func HasNoSpaces(s string) bool {
func extractTemplateVariables(url string) []string {
re := regexp.MustCompile(`\{([^}]+)\}`)
matches := re.FindAllStringSubmatch(url, -1)
var variables []string
for _, match := range matches {
if len(match) > 1 {
@ -55,16 +55,16 @@ func replaceTemplateVariables(rawURL string) string {
"{protocol}": "http",
"{scheme}": "http",
}
result := rawURL
for placeholder, replacement := range templateReplacements {
result = strings.ReplaceAll(result, placeholder, replacement)
}
// Handle any remaining {variable} patterns with generic placeholder
re := regexp.MustCompile(`\{[^}]+\}`)
result = re.ReplaceAllString(result, "placeholder")
return result
}
@ -72,7 +72,7 @@ func replaceTemplateVariables(rawURL string) string {
func IsValidURL(rawURL string) bool {
// Replace template variables with placeholders for parsing
testURL := replaceTemplateVariables(rawURL)
// Parse the URL
u, err := url.Parse(testURL)
if err != nil {
@ -131,19 +131,19 @@ func IsValidRemoteURL(rawURL string) bool {
if !IsValidURL(rawURL) {
return false
}
// Parse the URL to check for localhost restriction
u, err := url.Parse(rawURL)
if err != nil {
return false
}
// Reject localhost URLs for remotes (security/production concerns)
hostname := u.Hostname()
if hostname == "localhost" || hostname == "127.0.0.1" || strings.HasSuffix(hostname, ".localhost") {
return false
}
return true
}
@ -155,31 +155,31 @@ func IsValidTemplatedURL(rawURL string, availableVariables []string, allowTempla
if !IsValidURL(rawURL) {
return false
}
// Extract template variables from URL
templateVars := extractTemplateVariables(rawURL)
// If no templates are found, it's a valid static URL
if len(templateVars) == 0 {
return true
}
// If templates are not allowed (e.g., for remotes), reject URLs with templates
if !allowTemplates {
return false
}
// Validate that all template variables are available
availableSet := make(map[string]bool)
for _, v := range availableVariables {
availableSet[v] = true
}
for _, templateVar := range templateVars {
if !availableSet[templateVar] {
return false
}
}
return true
}

View file

@ -505,4 +505,4 @@ func isValidHostForDomain(hostname, publisherDomain string) bool {
}
return false
}
}

View file

@ -893,10 +893,10 @@ func TestValidate_ServerNameFormat(t *testing.T) {
func TestValidate_MultipleSlashesInServerName(t *testing.T) {
tests := []struct {
name string
serverName string
expectError bool
errorMsg string
name string
serverName string
expectError bool
errorMsg string
}{
{
name: "single slash - valid",
@ -1592,4 +1592,4 @@ func createValidServerWithArgument(arg model.Argument) apiv0.ServerJSON {
},
},
}
}
}