cucumber / polyglot-release

Make polyglot releases with a single command
MIT License
5 stars 1 forks source link

Use polyglot-release to release polyglot-release #65

Closed mpkorstanje closed 2 years ago

mpkorstanje commented 2 years ago

🤔 What's changed?

Fixes: #55 Fixes: #64

⚡️ What's your motivation?

We're getting to the point where polyglot-release will not need many changes. This makes issues such as #64 easier to deal with by properly versioning polyglot-release.

However making a release with an out of date version of polyglot-release may botch the release. For example, a newly added language may not be released. By checking if polyglot-release is up to date we can avoid these problems.

🏷️ What kind of change is this?

♻️ Anything particular you want feedback on?

The tests are a doozy.

📋 Checklist:

mpkorstanje commented 2 years ago

I think it makes sense to just disable this check for most of the tests, so I suggest making a DISABLE_CHECK_UP_TO_DATE env var which we set there instead, and unset it in the tests that specifically test that check.

I think you are fundamentally misunderstanding how the up to date check works. Could you give the code in check_up_to_date a careful reading.

Keep in mind that POLYGLOT_RELEASE_VERSION is only set when a release is made. So when released the script will always check GitHub. When not released, the script will not check GitHub. But we should always set POLYGLOT_RELEASE_GIT_REPO during tests to ensure that we never check with GitHub, not even in case of a mistake.

mpkorstanje commented 2 years ago

Wrote https://github.com/cucumber/polyglot-release/issues/67 to address the problem of having polyglot-release as a project specific implementation.

mpkorstanje commented 2 years ago

Due to time constraints I've merged this because I'd like to make a release of polyglot-release and start using it to release things. I think I've addressed the remaining problems sufficiently and/or put them on the backlog.

mattwynne commented 2 years ago

I think it makes sense to just disable this check for most of the tests, so I suggest making a DISABLE_CHECK_UP_TO_DATE env var which we set there instead, and unset it in the tests that specifically test that check.

I think you are fundamentally misunderstanding how the up to date check works. Could you give the code in check_up_to_date a careful reading.

Keep in mind that POLYGLOT_RELEASE_VERSION is only set when a release is made. So when released the script will always check GitHub. When not released, the script will not check GitHub. But we should always set POLYGLOT_RELEASE_GIT_REPO during tests to ensure that we never check with GitHub, not even in case of a mistake.

OK I think I get it now - the POLYGLOT_RELEASE_GIT_REPO variable only has a value for the commit that's released, then we change it back to empty in the post-release commit. So in general development use (development of polyglot-release, that is) it will have an empty value.

Correct?

mpkorstanje commented 2 years ago

You've confused POLYGLOT_RELEASE_GIT_REPO for POLYGLOT_RELEASE_VERSION but otherwise yes.

mattwynne commented 2 years ago

I'm easily confused!