Skip to content

Conversation

@JaimeSeqLabs
Copy link
Contributor

@JaimeSeqLabs JaimeSeqLabs commented Jul 24, 2025

Description

Closes PLAT-2365

Improves the error handling in label cmd.

Important

Additional testing guidelines included in the Jira ticket for Seqera developers (requires local Seqera Platform instance).

Guidelines for testing

  1. In Seqera Platform (production or local dev instance):
  2. Create a Tower Access Token if needed
  3. Export token and API endpoint:
$> export TOWER_ACCESS_TOKEN=<your_token>
$> export TOWER_API_ENDPOINT=http://localhost:8000/api  // omit this if you are targeting production
  1. Create an organization and workspace if none is available
  2. Try creating a new label with invalid syntax (use ./tw --insecure when targeting local dev instance):
$> ./tw labels add -w <workspace_identifier> -n test_label_# -v testValue

 ERROR: Unable to create label for workspace '268956704112485': Label name must contain a minimum of 2 and a maximum of 39 alphanumeric characters separated by dashes or underscores

The error message should contain the reason of the failure (invalid label name).

  1. Try updating an existing label with invalid syntax:
$> ./tw labels update -i <label_id> -w <workspace_identifier> -n test_label_# -v testValue

 ERROR: Unable to update label '125735402225740' for workspace '268956704112485': Label name must contain a minimum of 2 and a maximum of 39 alphanumeric characters separated by dashes or underscores

The error message should contain the reason of the failure (invalid label name).

  1. Try deleting a non-existent label:
$> ./tw labels delete -i <non_existent_label_id> -w <workspace_identifier>

 ERROR: Unable to delete label '185167563765341' for workspace '268956704112485': Cannot find label with the provided ID

The error message should contain the reason of the failure (label ID not found).

@JaimeSeqLabs JaimeSeqLabs marked this pull request as ready for review July 24, 2025 15:15
@JaimeSeqLabs JaimeSeqLabs self-assigned this Jul 24, 2025
Copy link
Contributor

@georgi-seqera georgi-seqera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm - works as expected:

(before and after)
image

@swingingsimian swingingsimian merged commit 3192152 into master Aug 8, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants