Add images & configs to deploy overview #657
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/3wc/550-deploy-overview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #550
I can't remember why I didn't try and implement showing secret version diffs, but at this point I'd suggest opening a new ticket if we want that also.
Testing is a bit minimal so far; open to extending it.
Also, full disclosure (maybe we should have a policy about this), I used an LLM to get some inspiration for
d775bcd76f. Most of the LLM-generated code has been completely rewritten by the time of this PR, it's all at least been human-reviewed.@ -200,3 +215,4 @@toDeployVersion,"",deployWarnMessages,strings.Join(secretInfo, "\n"),I would move the strings.Join to the deployOverview function
fa3e764fa6to428ffdfb88428ffdfb88to34934cf62d@ -38,2 +39,4 @@return nil}func GetConfigNameAndVersion(fullName string, stackName string) (string, string, error) {A comment that describes how it works would be nice. Maybe with a small example
Amazing work! My comments are just a bunch of optional / minor stuff and mostly
i18n.Gbusy work to polish off? Merge away when you're happy with it. Thanks! It might be nice to squash all the commits into afeat: ...commit also for the changelog labours, if you fancy it.@ -197,0 +208,4 @@}// Show deploy overviewRogue newline?
@ -40,0 +43,4 @@name := strings.TrimPrefix(fullName, stackName+"_")if lastUnderscore := strings.LastIndex(name, "_"); lastUnderscore != -1 {return name[0:lastUnderscore], name[lastUnderscore+1:], nil} else {Can drop the
elseand justreturn ....@ -0,0 +72,4 @@} else {// Just make sure the versions are the same..if existingConfigVersion != configVersion {log.Warnf("different versions for config '%s', '%s' and %s'", configBaseName, existingConfigVersion, configVersion)log.Warn(i18n.G("..."))@ -0,0 +119,4 @@} else {// Just make sure the versions are the same..if existingImageVersion != imageTag {log.Warnf("different versions for image '%s', '%s' and %s'", imageBaseName, existingImageVersion, imageTag)log.Warn(i18n.G("..."))@ -0,0 +129,4 @@}func GatherSecretsForDeploy(cl *dockerClient.Client, app appPkg.App) ([]string, error) {Rogue newline?
@ -0,0 +154,4 @@return nil, err}log.Debugf("Deployed config names: %v", currentConfigs)log.Debug(i18n.G("..."))(lowercase)@ -0,0 +161,4 @@var configInfo []stringfor configName := range newConfigs {log.Debugf("Searching abra.sh for version for %s", configName)log.Debug(i18n.G("..."))(lowercase)@ -0,0 +165,4 @@versionKey := strings.ToUpper(configName) + "_VERSION"newVersion, exists := abraShEnv[versionKey]if !exists {log.Warnf("No version found for config %s", configName)log.Warn(i18n.G("..."))(lowercase)@ -0,0 +166,4 @@newVersion, exists := abraShEnv[versionKey]if !exists {log.Warnf("No version found for config %s", configName)configInfo = append(configInfo, fmt.Sprintf("%s: ? (missing version)", configName))i18n.G("...")@ -0,0 +173,4 @@if currentVersion, exists := currentConfigs[configName]; exists {if currentVersion == newVersion {if showUnchanged {configInfo = append(configInfo, fmt.Sprintf("%s: %s (unchanged)", configName, newVersion))i18n.G("...")@ -0,0 +179,4 @@configInfo = append(configInfo, fmt.Sprintf("%s: %s → %s", configName, currentVersion, newVersion))}} else {configInfo = append(configInfo, fmt.Sprintf("%s: %s (new)", configName, newVersion))i18n.G("...")@ -0,0 +187,4 @@}func GatherImagesForDeploy(cl *dockerClient.Client, app appPkg.App, compose *composetypes.Config, showUnchanged bool) ([]string, error) {Rogue newline?
@ -0,0 +194,4 @@return nil, err}log.Debugf("Deployed images: %v", currentImages)log.Debug(i18n.G("..."))(lowercase)@ -0,0 +215,4 @@} else {// Just make sure the versions are the same..if existingImageVersion != imageTag {log.Warnf("different versions for image '%s', '%s' and %s'", imageBaseName, existingImageVersion, imageTag)log.Warn(i18n.G("..."))@ -0,0 +219,4 @@}}}log.Debugf("Proposed images: %v", newImages)log.Debug(i18n.G("..."))(lowercase)@ -0,0 +226,4 @@if currentVersion, exists := currentImages[newImageName]; exists {if currentVersion == newImageVersion {if showUnchanged {imageInfo = append(imageInfo, fmt.Sprintf("%s: %s (unchanged)", formatter.StripTagMeta(newImageName), newImageVersion))i18n.G("...")@ -0,0 +232,4 @@imageInfo = append(imageInfo, fmt.Sprintf("%s: %s → %s", formatter.StripTagMeta(newImageName), currentVersion, newImageVersion))}} else {imageInfo = append(imageInfo, fmt.Sprintf("%s: %s (new)", formatter.StripTagMeta(newImageName), newImageVersion))i18n.G("...")Awesome, thanks both, merging!
Add images, configs, secrets to deploy overviewto Add images & configs to deploy overview