Open alvaromartmart opened 6 months ago
Thanks for reporting @alvaromartmart, I've pushed a fix in #127 that should resolve this. As you rightly suggested, there was an issue in how we check for the value of the name
key or --name
arg that returned None
for when constructing arguments for teams
.
Testing with your above example:
$ seqerakit teams.yml --dryrun
DEBUG:root:DRYRUN: Running command tw teams add --name launchers --organization myorg --description 'Users with launcher permissions'
DEBUG:root:DRYRUN: Running command tw teams members --team launchers --organization myorg add --member launcher@myorg.io
DEBUG:root:DRYRUN: Running command tw teams add --name viewers --organization myorg --description 'Users with viewer permissions'
DEBUG:root:DRYRUN: Running command tw teams members --team viewers --organization myorg add --member viewer@myorg.io
Do you think in addition to checking for name
, we should check for workspace
for uniqueness? Most resources can't be duplicated within a workspace, but can within an organization, right?
Largely fixed in #127 but will leave this discussion open to make this more reliable in the future
I noticed this issue trying to create two different teams:
Trying to run this through
seqerakit
resulted in the error "Duplicate 'name' specified in config file for teams: None".I suspect what might be the reason:
https://github.com/seqeralabs/seqera-kit/blob/b09822083a798673c0331a0e30dc1c96766e342a/seqerakit/helper.py#L40-L44
parse_block
doesn't always generate commands with a--name
argument, for instanceparse_teams_block
doesn't as it relies on theparticipants add...
https://github.com/seqeralabs/seqera-kit/blob/b09822083a798673c0331a0e30dc1c96766e342a/seqerakit/helper.py#L184-L194I assume that's why it results as
None
, which is evaluated for uniqueness.It's very likely that this issue affects other entities.