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

Relax image repo and git repo regexes #915

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

moensch
Copy link
Contributor

@moensch moensch commented Oct 3, 2023

Fixes #846
Fixes #870

Note

I do have some code for a unit test ready-ish to validate this regex, but it does use go/ast and go/parser and is a bit .. involved. I pushed Copilot to its limits :)

Holler if you'd like me to add it.

Git regex validation

before

image

after

https://regex101.com/r/mjk9Ar/1
image

Docker repo regex validation

before

image

after

https://regex101.com/r/cnnffH/1
image

@netlify
Copy link

netlify bot commented Oct 3, 2023

Deploy Preview for docs-kargo-akuity-io canceled.

Name Link
🔨 Latest commit c5fa2d5
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/651e3de3ce1e250008b55c00

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (533af4a) 46.04% compared to head (c5fa2d5) 46.04%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #915   +/-   ##
=======================================
  Coverage   46.04%   46.04%           
=======================================
  Files          95       95           
  Lines        6759     6759           
=======================================
  Hits         3112     3112           
  Misses       3497     3497           
  Partials      150      150           
Files Coverage Δ
api/v1alpha1/stage_types.go 78.26% <ø> (ø)

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

@krancour
Copy link
Member

krancour commented Oct 4, 2023

@moensch this is stellar and extemely thorough. ❤️ Changes to regular expressions are sometimes very hard to review. I love how easy you made it to see the before and after results.

I did make some suggestions because if we're going to touch these particular expressions anyway, I think there are other outstanding things that need to be addressed.

I'd like to know what you think. I especially want to know if you feel the proposed alternatives do indeed retain the "relaxation" you were out to get, which I think can be summarized as allowing both - and . as separators in more places.

Fixes akuity#846
Fixes akuity#870

Signed-off-by: Samuel Suter <samuel@suter.is>
@krancour
Copy link
Member

krancour commented Oct 5, 2023

@moensch thanks so much!

@krancour krancour self-requested a review October 5, 2023 14:24
@krancour krancour merged commit 5659ce7 into akuity:main Oct 5, 2023
tal-hason pushed a commit to tal-hason/kargo that referenced this pull request Oct 6, 2023
Signed-off-by: Samuel Suter <samuel@suter.is>
Signed-off-by: Tal Hason <thason@redhat.com>
moensch added a commit to moensch/kargo that referenced this pull request Oct 6, 2023
Signed-off-by: Samuel Suter <samuel@suter.is>
krancour added a commit that referenced this pull request Oct 11, 2023
Signed-off-by: Samuel Suter <samuel@suter.is>
Co-authored-by: Kent Rancourt <kent.rancourt@gmail.com>
@krancour krancour added this to the v0.2.0 milestone Oct 13, 2023
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.

relax regex for git repo urls image subscription repoURL does not allow . in the image name
2 participants