Add images & configs to deploy overview #657

Merged
3wordchant merged 28 commits from feature/3wc/550-deploy-overview into main 2025-09-09 17:22:06 +00:00
Owner

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.

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 d775bcd76fabd5d48754e0cd264447a7f3b1263f . Most of the LLM-generated code has been completely rewritten by the time of this PR, it's all at least been human-reviewed.
3wordchant added 22 commits 2025-09-08 18:50:43 +00:00
3wordchant added 1 commit 2025-09-08 18:59:41 +00:00
chore: 4matting
Some checks failed
continuous-integration/drone/push Build is failing
86c1c9d554
3wordchant added 1 commit 2025-09-08 19:00:56 +00:00
chore: POT
All checks were successful
continuous-integration/drone/push Build is passing
02e352ae57
p4u1 reviewed 2025-09-08 19:25:28 +00:00
@ -200,3 +215,4 @@
toDeployVersion,
"",
deployWarnMessages,
strings.Join(secretInfo, "\n"),
Member

I would move the strings.Join to the deployOverview function

I would move the strings.Join to the deployOverview function
3wordchant marked this conversation as resolved
3wordchant added 1 commit 2025-09-09 02:05:55 +00:00
Move strings.Join to DeployOverview
All checks were successful
continuous-integration/drone/push Build is passing
fa3e764fa6
3wordchant force-pushed feature/3wc/550-deploy-overview from fa3e764fa6 to 428ffdfb88 2025-09-09 02:07:02 +00:00 Compare
3wordchant force-pushed feature/3wc/550-deploy-overview from 428ffdfb88 to 34934cf62d 2025-09-09 02:12:34 +00:00 Compare
p4u1 reviewed 2025-09-09 07:54:04 +00:00
@ -38,2 +39,4 @@
return nil
}
func GetConfigNameAndVersion(fullName string, stackName string) (string, string, error) {
Member

A comment that describes how it works would be nice. Maybe with a small example

A comment that describes how it works would be nice. Maybe with a small example
3wordchant marked this conversation as resolved
decentral1se reviewed 2025-09-09 08:14:40 +00:00
decentral1se left a comment
Owner

Amazing work! My comments are just a bunch of optional / minor stuff and mostly i18n.G busy work to polish off? Merge away when you're happy with it. Thanks! It might be nice to squash all the commits into a feat: ... commit also for the changelog labours, if you fancy it.

Amazing work! My comments are just a bunch of optional / minor stuff and mostly `i18n.G` busy work to polish off? Merge away when you're happy with it. Thanks! It might be nice to squash all the commits into a `feat: ...` commit also for the changelog labours, if you fancy it.
@ -197,0 +208,4 @@
}
// Show deploy overview
Owner

Rogue newline?

Rogue newline?
3wordchant marked this conversation as resolved
@ -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 {
Owner

Can drop the else and just return ....

Can drop the `else` and just `return ...`.
3wordchant marked this conversation as resolved
@ -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)
Owner

log.Warn(i18n.G("..."))

`log.Warn(i18n.G("..."))`
3wordchant marked this conversation as resolved
@ -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)
Owner

log.Warn(i18n.G("..."))

```log.Warn(i18n.G("..."))```
3wordchant marked this conversation as resolved
@ -0,0 +129,4 @@
}
func GatherSecretsForDeploy(cl *dockerClient.Client, app appPkg.App) ([]string, error) {
Owner

Rogue newline?

Rogue newline?
3wordchant marked this conversation as resolved
@ -0,0 +154,4 @@
return nil, err
}
log.Debugf("Deployed config names: %v", currentConfigs)
Owner

log.Debug(i18n.G("...")) (lowercase)

```log.Debug(i18n.G("..."))``` (lowercase)
3wordchant marked this conversation as resolved
@ -0,0 +161,4 @@
var configInfo []string
for configName := range newConfigs {
log.Debugf("Searching abra.sh for version for %s", configName)
Owner

log.Debug(i18n.G("...")) (lowercase)

```log.Debug(i18n.G("..."))``` (lowercase)
3wordchant marked this conversation as resolved
@ -0,0 +165,4 @@
versionKey := strings.ToUpper(configName) + "_VERSION"
newVersion, exists := abraShEnv[versionKey]
if !exists {
log.Warnf("No version found for config %s", configName)
Owner

log.Warn(i18n.G("...")) (lowercase)

```log.Warn(i18n.G("..."))``` (lowercase)
3wordchant marked this conversation as resolved
@ -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))
Owner

i18n.G("...")

`i18n.G("...")`
3wordchant marked this conversation as resolved
@ -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))
Owner

i18n.G("...")

`i18n.G("...")`
3wordchant marked this conversation as resolved
@ -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))
Owner

i18n.G("...")

`i18n.G("...")`
3wordchant marked this conversation as resolved
@ -0,0 +187,4 @@
}
func GatherImagesForDeploy(cl *dockerClient.Client, app appPkg.App, compose *composetypes.Config, showUnchanged bool) ([]string, error) {
Owner

Rogue newline?

Rogue newline?
3wordchant marked this conversation as resolved
@ -0,0 +194,4 @@
return nil, err
}
log.Debugf("Deployed images: %v", currentImages)
Owner

log.Debug(i18n.G("...")) (lowercase)

```log.Debug(i18n.G("..."))``` (lowercase)
3wordchant marked this conversation as resolved
@ -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)
Owner

log.Warn(i18n.G("..."))

```log.Warn(i18n.G("..."))```
3wordchant marked this conversation as resolved
@ -0,0 +219,4 @@
}
}
}
log.Debugf("Proposed images: %v", newImages)
Owner

log.Debug(i18n.G("...")) (lowercase)

```log.Debug(i18n.G("..."))``` (lowercase)
3wordchant marked this conversation as resolved
@ -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))
Owner

i18n.G("...")

`i18n.G("...")`
3wordchant marked this conversation as resolved
@ -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))
Owner

i18n.G("...")

`i18n.G("...")`
3wordchant marked this conversation as resolved
3wordchant added 3 commits 2025-09-09 17:19:33 +00:00
chore: update POT
All checks were successful
continuous-integration/drone/push Build is passing
39d1997edf
Author
Owner

Awesome, thanks both, merging!

Awesome, thanks both, merging!
3wordchant merged commit 39d1997edf into main 2025-09-09 17:22:06 +00:00
3wordchant deleted branch feature/3wc/550-deploy-overview 2025-09-09 17:22:06 +00:00
decentral1se changed title from Add images, configs, secrets to deploy overview to Add images & configs to deploy overview 2025-09-10 19:57:09 +00:00
Sign in to join this conversation.
No description provided.