Compare commits

...

4 Commits

Author SHA1 Message Date
9e7bc31d4d avoiding #732 by checking for empty versions list for recipe sync
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-12-18 14:41:58 -08:00
b79c4f33b6 chore: update translation files
Some checks failed
continuous-integration/drone/push Build is failing
Updated by "Update PO files to match POT (msgmerge)" add-on in Weblate.

Translation: Co-op Cloud/abra
Translate-URL: https://translate.coopcloud.tech/projects/co-op-cloud/abra/
2025-12-14 15:02:41 +00:00
cc87d5b3da chore: remove reference to wizard mode from recipe upgrade cli docs
Some checks failed
continuous-integration/drone/push Build is failing
2025-12-13 15:26:12 +11:00
8b5e3f3c78 chore: translation using Weblate (Spanish)
Currently translated at 9.5% (109 of 1140 strings)

Translation: Co-op Cloud/abra
Translate-URL: https://translate.coopcloud.tech/projects/co-op-cloud/abra/es/
2025-12-10 01:43:58 +00:00
6 changed files with 59 additions and 25 deletions

View File

@ -121,20 +121,15 @@ likely to change.
log.Fatal(err)
}
versions, err := recipePkg.GetRecipeCatalogueVersions(recipe.Name, catl)
if err != nil {
log.Fatal(err)
}
changesTable, err := formatter.CreateTable()
if err != nil {
log.Fatal(err)
}
latestRelease := tags[len(tags)-1]
latestRecipeVersion := getLatestVersion(recipe, catl)
changesTable.Headers(i18n.G("SERVICE"), latestRelease, i18n.G("PROPOSED CHANGES"))
latestRecipeVersion := versions[len(versions)-1]
allRecipeVersions := catl[recipe.Name].Versions
for _, recipeVersion := range allRecipeVersions {
if serviceVersions, ok := recipeVersion[latestRecipeVersion]; ok {
@ -298,3 +293,15 @@ func init() {
i18n.G("increase the patch part of the version"),
)
}
func getLatestVersion(recipe recipePkg.Recipe, catl recipePkg.RecipeCatalogue) string {
versions, err := recipePkg.GetRecipeCatalogueVersions(recipe.Name, catl)
if err != nil {
log.Fatal(err)
}
latestRecipeVersion := "0.0.0"
if len(versions) > 0 {
latestRecipeVersion = versions[len(versions)-1]
}
return latestRecipeVersion
}

33
cli/recipe/sync_test.go Normal file
View File

@ -0,0 +1,33 @@
package recipe
import (
"testing"
recipePkg "coopcloud.tech/abra/pkg/recipe"
"github.com/stretchr/testify/assert"
)
func TestGetLatestVersionReturnsDefault(t *testing.T) {
recipe := recipePkg.Recipe{}
catalogue := recipePkg.RecipeCatalogue{}
version := getLatestVersion(recipe, catalogue)
assert.Equal(t, version, "0.0.0")
}
func TestGetLatestVersionReturnsLastVersion(t *testing.T) {
recipe := recipePkg.Recipe{
Name: "test",
}
versions := []map[string]map[string]recipePkg.ServiceMeta{
make(map[string]map[string]recipePkg.ServiceMeta),
make(map[string]map[string]recipePkg.ServiceMeta),
}
versions[0]["0.0.3"] = make(map[string]recipePkg.ServiceMeta)
versions[1]["0.0.2"] = make(map[string]recipePkg.ServiceMeta)
catalogue := make(recipePkg.RecipeCatalogue)
catalogue["test"] = recipePkg.RecipeMeta{
Versions: versions,
}
version := getLatestVersion(recipe, catalogue)
assert.Equal(t, version, "0.0.3")
}

View File

@ -57,9 +57,7 @@ is up to the end-user to decide.
The command is interactive and will show a select input which allows you to
make a seclection. Use the "?" key to see more help on navigating this
interface.
You may invoke this command in "wizard" mode and be prompted for input.`),
interface.`),
Args: cobra.RangeArgs(0, 1),
ValidArgsFunction: func(
cmd *cobra.Command,

View File

@ -1500,9 +1500,7 @@ msgid "Upgrade a given <recipe> configuration.\n"
"\n"
"The command is interactive and will show a select input which allows you to\n"
"make a seclection. Use the \"?\" key to see more help on navigating this\n"
"interface.\n"
"\n"
"You may invoke this command in \"wizard\" mode and be prompted for input."
"interface."
msgstr ""
#. translators: Short description for `upgrade` command

Binary file not shown.

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2025-11-04 15:34+0100\n"
"PO-Revision-Date: 2025-09-04 08:14+0000\n"
"PO-Revision-Date: 2025-12-10 01:43+0000\n"
"Last-Translator: chasqui <chasqui@cryptolab.net>\n"
"Language-Team: Spanish <https://translate.coopcloud.tech/projects/co-op-cloud/abra/es/>\n"
"Language: es\n"
@ -1272,12 +1272,12 @@ msgstr "▶️ Restaurar una captura o instantánea 📸"
#. translators: Short description for `app rollback` command
#: cli/app/rollback.go:34
msgid "Roll an app back to a previous version"
msgstr "⏪ Revertir una plataforma 🚀 una versión anterior"
msgstr "⏪ Revertir una aplicación 🚀 una versión anterior"
#. translators: Short description for `app run` command
#: cli/app/run.go:30
msgid "Run a command inside a service container"
msgstr "💻 Ejecuta un comando dentro de un contenedor 🐋 creado solo para esa tarea"
msgstr "💻 Crea una instancia temporal de un contenedor 🐋 para ejecutar el comando especificado"
#: cli/app/cmd.go:31
msgid ""
@ -1296,7 +1296,7 @@ msgstr ""
#. translators: Short description for `app cmd` command
#: cli/app/cmd.go:30
msgid "Run app commands"
msgstr "💻 Ejecutar comandos en una plataforma 🚀"
msgstr "💻 Ejecutar comandos en una aplicación 🚀"
#: cli/app/backup.go:303 cli/app/list.go:292 cli/app/logs.go:109
#: cli/app/new.go:389
@ -1399,7 +1399,7 @@ msgstr ""
#. translators: Short description for `app logs` command
#: cli/app/logs.go:27
msgid "Tail app logs"
msgstr "📋 Seguir logs 📈 de la plataforma 🚀"
msgstr "📋 Seguir logs 📈 de la aplicación 🚀"
#. translators: Short description for `abra` binary
#: cli/run.go:80
@ -1551,9 +1551,7 @@ msgid ""
"\n"
"The command is interactive and will show a select input which allows you to\n"
"make a seclection. Use the \"?\" key to see more help on navigating this\n"
"interface.\n"
"\n"
"You may invoke this command in \"wizard\" mode and be prompted for input."
"interface."
msgstr ""
#. translators: Short description for `upgrade` command
@ -1575,7 +1573,7 @@ msgstr ""
#. translators: Short description for `app upgrade` command
#: cli/app/upgrade.go:36
msgid "Upgrade an app"
msgstr "📨 Actualizar una plataforma 🚀"
msgstr "📨 Actualizar una aplicación 🚀"
#: cli/app/upgrade.go:37
msgid ""
@ -1863,12 +1861,12 @@ msgstr ""
#. translators: `abra app` command for autocompletion
#: cli/run.go:91
msgid "app"
msgstr "plataforma"
msgstr "aplicacion"
#. translators: `app` command group
#: cli/app/app.go:16
msgid "app [cmd] [args] [flags]"
msgstr "plataforma [cmd] [args] [flags]"
msgstr "aplicacion [cmd] [args] [flags]"
#: pkg/dns/dns.go:52
#, c-format
@ -4621,7 +4619,7 @@ msgstr ""
#. translators: `app run` command
#: cli/app/run.go:27
msgid "run <domain> <service> <cmd> [[args] [flags] | [flags] -- [args]]"
msgstr "lanzar <domain> <service> <cmd> [[args] [flags] | [flags] -- [args]]"
msgstr "correr <domain> <service> <cmd> [[args] [flags] | [flags] -- [args]]"
#: cli/app/run.go:120
msgid "run command as user"
@ -5509,7 +5507,7 @@ msgstr ""
#. translators: `app undeploy` command
#: cli/app/undeploy.go:28
msgid "undeploy <domain> [flags]"
msgstr "desarmar <domain> [flags]"
msgstr "recoger <domain> [flags]"
#: cli/app/undeploy.go:117
msgid "undeploy succeeded 🟢"