Galaxy-importer enforces undocumented length limitations on collection metadata

Ohai,

galaxy-importer has code to enforce a schema upon the metadata in galaxy.yml:

I think this is problematic for two reasons:

  1. those lengths are not documented as limits in Collection Galaxy metadata structure — Ansible Community Documentation (which I consider the source of truth when developing things)
  2. it’s super easy to hit those limits - even the example in the docs Full Name <email> (url) @nicks:irc/im.site#channel is very close at 51 characters (vs 64), just imagine someone with a more complicated name than “Full Name” shows up :wink:

Please reconsider limiting those fields, especially at such low lengths.

4 Likes

( Can’t not link to Falsehoods Programmers Believe About Names | Kalzumeus Software and Falsehoods Programmers Believe About Names - With Examples - Shine Solutions Group, sorry )

2 Likes

BTW, SPDX License List | Software Package Data Exchange (SPDX) does contain licences with identifiers longer than 32:

  • Mackerras-3-Clause-acknowledgment
  • BSD-3-Clause-No-Nuclear-License-2014
  • X11-distribute-modifications-variant
1 Like

I am not sure on the reasoning for this but IMO, this feels arbitrarily enforced especially since given the example, near one author could reach this limit.

I understand the others or at least can see reasoning but personally, I am not sure this should be this low. I think their should be hard a cap (working in python has made realize, even if it might seem out of reach, always set a limit) but I do believe that it should be something that is near impossible to hit.

@allhart @chynasan what do you all think about potentially changing this in one of the next releases?

3 Likes

I don’t see any issues with raising the limit for at least author and license by a fair amount, but I wonder if there’s any historical reason for these values being so limited.

I’m guessing namespace and collection name (aka NAME) shouldn’t change due to other dependencies in pulp/galaxy_NG, and tag at 64 char seems like a reasonable amount IMO.

Maybe raising LICENSE to 64/128 char and AUTHOR to 256 char would give enough leeway? We can always go higher if needed, as long as there’s not something in galaxy_NG that will break if we raise it too much.

Whatever we do or don’t do, I agree with @evgeni - this should be documented somewhere on docs.ansible.

@tannerjc What do you think?

2 Likes

Those limitation were Introduced by this PR:

There is a link to:

For the authors field, currently the limit is noticed when there is a database error in AH, and this is displayed to the user:
{'authors': {1: [ErrorDetail(string='Ensure this field has no more than 64 characters.', code='max_length')]}}
Loading...

Is this a still valid consideration that AH has 64 chars limit?

1 Like

I see that pulp_ansible still has the limitations with max_length for several fields. So it seems that fixing galaxy-importer alone will not solve the problem.

1 Like