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(pyclient ci): validate version arg in create-release #1473

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

dshemetov
Copy link
Contributor

@dshemetov dshemetov commented Jun 7, 2024

Summary:

Started from this conversation.

Fix the release CI to accept any version number and major, minor, patch as its argument. My test script for the versionNumber logic is below.

Notes:

# Try (major|minor|patch|5.3.0|blah|3.2.2.2)
versionName=major
allowed_pattern="^(major|minor|patch|[0-9]+\.[0-9]+\.[0-9]+)$"

if [[ ! $versionName =~ $allowed_pattern ]]; then
  echo "\nInvalid version name: $versionName"
  exit 1
fi

if [[ $versionName =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
  NEXT_TAG="$versionName"
else
  NEXT_TAG=$(bump2version --dry-run --list $versionName | grep ^new_version | sed -r s,"^.*=",,)
fi
echo "next_tag=$NEXT_TAG"

Prerequisites:

  • Unless it is a documentation hotfix it should be merged against the dev branch
  • Branch is up-to-date with the branch to be merged with, i.e. dev
  • Build is successful
  • Code is cleaned up and formatted

@dshemetov dshemetov changed the title wip(pyclient): use bump-my-version fix(pyclient ci): use bump-my-version Jun 7, 2024
@dshemetov dshemetov changed the title fix(pyclient ci): use bump-my-version fix(pyclient ci): validate version arg in create-release Jun 7, 2024
@dshemetov dshemetov requested a review from melange396 June 7, 2024 23:27
Copy link
Contributor

@rzats rzats left a comment

Choose a reason for hiding this comment

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

lgtm!

src/client/packaging/pypi/pyproject.toml Outdated Show resolved Hide resolved
src/client/packaging/pypi/.bumpversion.cfg Outdated Show resolved Hide resolved
.github/workflows/create-release.yml Outdated Show resolved Hide resolved
requirements.dev.txt Outdated Show resolved Hide resolved
* add comments
* revert bumpversion configs

Co-authored-by: george <george.haff@gmail.com>
Copy link

sonarcloud bot commented Jun 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@dshemetov
Copy link
Contributor Author

Cleaned up the commit log by squashing the edits.

@dshemetov dshemetov merged commit e41c741 into rzatserkovnyi/client-release-decouple Jun 18, 2024
6 checks passed
@dshemetov dshemetov deleted the ds/bump-version branch June 18, 2024 00:44
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