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

fix: updateGitTagRefs not working for versions like 0.1.2+3 #456

Merged
merged 2 commits into from
Jan 31, 2023

Conversation

fischerscode
Copy link
Contributor

Description

Fix #455

The expression did not allow the patch version for 0. packages.

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@CLAassistant
Copy link

CLAassistant commented Jan 30, 2023

CLA assistant check
All committers have signed the CLA.

@@ -107,7 +107,7 @@ RegExp hostedDependencyVersionReplaceRegex(String dependencyName) {

RegExp dependencyTagReplaceRegex(String dependencyName) {
return RegExp(
'''(?<tag_ref>^\\s+ref\\s?:\\s?)(?<opening_quote>["']?)(?<tag>$dependencyName-v[\\d]+\\.[\\d]+\\.[\\d]+)(?<closing_quote>['"]?)\$''',
'''(?<tag_ref>^\\s+ref\\s?:\\s?)(?<opening_quote>["']?)(?<tag>$dependencyName-v[\\d]+\\.[\\d]+\\.[\\d]+(?:\\+.*)?)(?<closing_quote>['"]?)\$''',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did intentionally use .*. However, one could argue, that \\d+ might be better.

@blaugold blaugold linked an issue Jan 31, 2023 that may be closed by this pull request
@blaugold
Copy link
Collaborator

@fischerscode Thanks for the contribution!

While looking at your PR, I felt we should refactor the code for replacing versions a bit more, fix more edge cases and add tests. Regular expressions are probably not the best approach now that there is yaml_edit but that would be a bigger task.

@blaugold blaugold merged commit 2a4f5ff into invertase:main Jan 31, 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
3 participants