Skip to content

feat: prepare for next release (based on prql-python 0.6.0)#142

Merged
eitsupi merged 4 commits into
mainfrom
fix-release
Mar 12, 2023
Merged

feat: prepare for next release (based on prql-python 0.6.0)#142
eitsupi merged 4 commits into
mainfrom
fix-release

Conversation

@eitsupi
Copy link
Copy Markdown
Member

@eitsupi eitsupi commented Mar 12, 2023

Based on the discussion on #140, preparing for the next release.

A little research shows that python-semantic-release is used in the following repository and will probably work.......
https://github.com/python-gitlab/python-gitlab/blob/d387d91401fdf933b1832ea2593614ea6b7d8acf/.github/workflows/release.yml

@eitsupi eitsupi marked this pull request as draft March 12, 2023 07:19
@eitsupi eitsupi added the pr-release Do a release on merge label Mar 12, 2023
@eitsupi
Copy link
Copy Markdown
Member Author

eitsupi commented Mar 12, 2023

By the way, I just realized the other day that python-semantic-release only lists "feat" and "fix" types commits in Changelog for now, but I forgot that and used "build" in #141...

@eitsupi eitsupi marked this pull request as ready for review March 12, 2023 07:36
@eitsupi
Copy link
Copy Markdown
Member Author

eitsupi commented Mar 12, 2023

Current changelog.

$ semantic-release changelog --unreleased
### Feature
* Support target option ([#140](https://github.com/eitsupi/pyprql/issues/140)) ([`393bc65`](https://github.com/eitsupi/pyprql/commit/393bc65690fc4e31d863708e1564a68225c7624d))
* Upgrade to prql-python 0.4 ([#129](https://github.com/eitsupi/pyprql/issues/129)) ([`ba5afa8`](https://github.com/eitsupi/pyprql/commit/ba5afa80fb27b8d998c39789f110c4e1ce1904de))

### Fix
* Manually fix version of pyproject.toml ([`6b5d43d`](https://github.com/eitsupi/pyprql/commit/6b5d43d5bede60f83e30ff1543a96f8421bfb7e1))

### Documentation
* Fix docs build ([#118](https://github.com/eitsupi/pyprql/issues/118)) ([`c7e7365`](https://github.com/eitsupi/pyprql/commit/c7e73656c27b7891dc61053b5cca4b64c299e555))

@eitsupi eitsupi changed the title chore: prepare for next release feat: prepare for next release (based on prql-python 0.6.0) Mar 12, 2023
@eitsupi
Copy link
Copy Markdown
Member Author

eitsupi commented Mar 12, 2023

Sorry, please let the type of commit by this PR be "feat" in order to have the prql-python version listed in the Changelog.......

@eitsupi eitsupi merged commit 05e0adf into main Mar 12, 2023
@eitsupi eitsupi deleted the fix-release branch March 12, 2023 07:42
@max-sixty
Copy link
Copy Markdown
Member

Looking good! Thank you v much @eitsupi

@eitsupi
Copy link
Copy Markdown
Member Author

eitsupi commented Mar 12, 2023

The generation of the changelog seems to have worked, but the commit failed and the release also failed.

I think it is because the main branch is a protected branch with status checks set.

debug: set_new_version('0.6.0')
debug: Writing new version number: path=PosixPath('pyprql/__init__.py') pattern='__version__ *[:=] *["\\\'](\\d+\\.\\d+\\.\\d+(-beta\\.\\d+)?)["\\\']' num_matches=1
debug: set_new_version -> True
debug: commit_new_version('0.6.0')
debug: commit_new_version -> [main 556757d] 0.6.0
debug:  3 files changed, 11 insertions(+), 2 deletions(-)
debug: tag_new_version('0.6.0')
debug: tag_new_version -> 
Pushing new version
debug: get_hvcs()
debug: get_hvcs -> <class 'semantic_release.hvcs.Github'>
debug: get_hvcs()
debug: get_hvcs -> <class 'semantic_release.hvcs.Github'>
debug: push_new_version(, auth_token='***', owner='PRQL', name='pyprql', branch=main, domain='github.com')
error: Cmd('git') failed due to: exit code(1)
error:   cmdline: git push ***github.com/PRQL/pyprql.git main
error:   stderr: 'remote: error: GH006: Protected branch update failed for refs/heads/main.        
error: remote: error: 2 of 2 required status checks are expected. You're not authorized to push to this branch. Visit https://docs.github.com/articles/about-protected-branches/ for more information.        
error: To https://github.com/PRQL/pyprql.git
error:  ! [remote rejected] main -> main (protected branch hook declined)
error: error: failed to push some refs to 'https://github.com/PRQL/pyprql.git''

@max-sixty
Copy link
Copy Markdown
Member

Hmmm. I'll try disabling the check...

@eitsupi
Copy link
Copy Markdown
Member Author

eitsupi commented Mar 12, 2023

Sorry, I made another commit (#143), so re-running the workflow also failed.......

I will try another PR.

@max-sixty
Copy link
Copy Markdown
Member

OK!

BTW if there are easier ways to do things like releases and changelogs, and you'd like to make changes — I have no loyalty to the current system :)

@eitsupi
Copy link
Copy Markdown
Member Author

eitsupi commented Mar 12, 2023

Yes, when weighing branch protection vs. current workflow, I believe accident prevention through branch protection is more important......

While the automatic generation of changelogs is useful, it would make sense to move to a new workflow that not using automatic commits, since the user can run semantic-release changelog --unreleased locally and paste it in Changelog.

@max-sixty
Copy link
Copy Markdown
Member

I agree!

(I think it might be possible to do both, by using a token and giving prql-bot permissions, but we're not doing releases that often...)

@eitsupi
Copy link
Copy Markdown
Member Author

eitsupi commented Mar 12, 2023

Anyway, it seems that the workflow failed again because of the protected branch (manual execution didn't help).

In https://github.com/python-gitlab/python-gitlab, the workflow on the main branch seems to work well despite being protected, so perhaps there is a way.
Could you please play with the branch protection settings and run the workflow manually?

@max-sixty
Copy link
Copy Markdown
Member

OK, I tried removing all protections and running manually... https://github.com/PRQL/pyprql/actions/runs/4396531246

@eitsupi
Copy link
Copy Markdown
Member Author

eitsupi commented Mar 12, 2023

Thank you.
Sorry, I was not aware that Poetry was required for the release. I will fix it the next PR.......

@max-sixty
Copy link
Copy Markdown
Member

No prob, thank you very much for helping!

(FYI I'm off for the night, as ever feel free to do whatever you think is best, happy to help tomorrow)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-release Do a release on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants