Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dots in environment names (specifically, in version numbers). #47

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

mjkw31
Copy link
Contributor

@mjkw31 mjkw31 commented Feb 22, 2024

Modified the name validation regexp to allow dots after the first character (to prevent hidden files, and parent directory refs).

@mjkw31 mjkw31 requested review from sb10 and sersorrel February 22, 2024 13:03
@mjkw31 mjkw31 requested a review from altaf-ali as a code owner February 22, 2024 13:03
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (4a14936) 63.13% compared to head (e7583c2) 63.13%.

Files Patch % Lines
softpack_core/schemas/environment.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #47   +/-   ##
========================================
  Coverage    63.13%   63.13%           
========================================
  Files           17       17           
  Lines          868      868           
  Branches       153      153           
========================================
  Hits           548      548           
  Misses         313      313           
  Partials         7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sersorrel
Copy link
Member

sersorrel commented Feb 22, 2024

This will cause a problem with #48 (https://github.com/wtsi-hgi/softpack-core/pull/48/files#diff-7d1716a6cc7338126394855a08f774de9bf287534431df547fc03c25fce75317R375-R378):

            m = re.fullmatch(r"^(.*)-(\d+)$", env.name)
            if not m:
                raise Exception
            versionless_name, version = m.groups()

This should be fine – the integer version number is unconditionally appended for environments created via the GraphQL createEnvironment endpoint, so this just allows dots in names, and as a side-effect permits version numbers with dots to be passed to createFromModule.

Copy link
Member

@sersorrel sersorrel left a comment

Choose a reason for hiding this comment

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

It's unfortunate that the new test doesn't get run in CI (because the whole of test_environment.py has the repo mark) – frustratingly it doesn't seem like there's a way to "unmark" a specific test when the whole file is marked.

@sb10 sb10 merged commit 4e2dc5e into develop Feb 22, 2024
4 of 5 checks passed
@sb10 sb10 deleted the allow-dot-in-env-names branch February 22, 2024 16:15
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.

3 participants