-
Notifications
You must be signed in to change notification settings - Fork 47
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
Default branch to main
instead of master
#172
base: master
Are you sure you want to change the base?
Conversation
Hi @RSickenberg, Thanks a lot for this PR 👍 There is still an issue with the tests because they rely on a small embedded Git repo: https://github.com/liip/RMT/blob/master/test/Liip/RMT/Tests/Unit/VCS/gitRepo.zip where the branch is still named This is showing us, that changing the main branch name is a breaking change for existing RMT install (existing projects that are still using the I imagine something like this:
To locally run the tests, there is a documentation here: https://github.com/liip/RMT/blob/master/README.md#tests Thanks again for your efforts! |
Sorry for this, didn't knew the existence of this file
Thanks, @jeanmonod for the input! Like I wrote on cd3b975, I didn't know about this small repo before so this answers the question I had about this. I indeed followed the documentation, but my tests are differing from the CI, I have ~6/7 failures VS 2 (one should be fixed now) on the CI. I would love to contribute more on a migration script, let me some time to do so 🙂 |
@RSickenberg Changing the repo is an option to fix the tests. But you are still leaving alone all the users working with a |
@jeanmonod Sure, I will find a way to take care of that! |
Hello @jeanmonod, could you run the tests? What do you think of the current approach? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @RSickenberg
I just did a first review! At this end, it's not an easy-pick
at all. Sorry for that.
Can I ask you one more thing? To keep master
branch name into the functional tests. Like this: 1) It's testing to use a different branch than main
. So it's ensuring backward compat 2) We don't need to change the embedded Git repo?
.gitignore
Outdated
@@ -5,3 +5,4 @@ cache.properties | |||
bin | |||
!bin/UpdateApplicationVersionCurrentVersion.php | |||
.phpunit.result.cache | |||
.idea/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this for your local git ignore
README.md
Outdated
@@ -6,15 +6,15 @@ RMT - Release Management Tool | |||
[![Total Downloads](https://poser.pugx.org/liip/RMT/d/total.png)](https://packagist.org/packages/liip/RMT) | |||
[![License](https://poser.pugx.org/liip/rmt/license.svg)](https://packagist.org/packages/liip/rmt) | |||
|
|||
RMT is a handy tool to help releasing new versions of your software. You can define the type | |||
RMT is a handy tool to help releasing a new versions of your software. You can define the type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new versionS. It was just before
README.md
Outdated
@@ -123,12 +123,12 @@ RMT also support JSON configs, but we recommend using YAML. | |||
### Branch specific config | |||
|
|||
Sometimes you want to use a different release strategy according to the VCS branch, e.g. you want to add CHANGELOG entries only in the `master` branch. To do so, you have to place your default config into a root element named `_default`, then you can override parts of this default config for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One missing master
here
'choices' => array('main', 'master'), | ||
'choices_shortcuts' => array('m' => 'main', 'mst' => 'master'), | ||
'default' => 'main', | ||
)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like so much this question. If the user is saying none
at the previous question, then it makes no sense to ask him a branch name.
But I have to admit that in most case users will use Git. Maybe allow also a choice n=>none
. And adjust a bit the question:
The default branch you want to use (select none if you are not using a VCS system)
@@ -24,8 +26,8 @@ _default: | |||
ask-confirmation: true | |||
|
|||
# BRANCH SPECIFIC CONFIG | |||
# On master, we override the general config | |||
master: | |||
# On main, we override the general config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also use the %%main-branch%%
in this comment
@@ -19,17 +19,35 @@ public function testInitialVersion(): void | |||
$this->createConfig('simple', 'vcs-tag', array('vcs' => 'git')); | |||
exec('./RMT release -n --confirm-first'); | |||
exec('git tag', $tags); | |||
// $this->manualDebug(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep all this $this->manualDebug();
, they are very usefully to debug
$this->initGit(); | ||
$this->createConfig('simple', 'vcs-tag', ['vcs' => 'git']); | ||
exec('git branch --show-current', $branch); | ||
self::assertEquals('main', $branch[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you testing here? To me this is not testing RMT...
self::assertEquals('master', $branch[0]); | ||
exec('./RMT release -n --confirm-first'); | ||
exec('git tag', $tags); | ||
self::assertEquals('1', $tags[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I'm not really sure what you are testing. How could this test fail?
.rmt.yml
Outdated
vcs: git | ||
vcs: | ||
name: git | ||
main-branch: main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do one thing at a time. Let's first merge this PR and then after this, I will change the main branch name of this repo. So please set master
here for now
Hey @jeanmonod, can you run the tests, please? I saw I checked your comments so you might want to look at it :) Regards |
Hi @RSickenberg, |
Hello @jeanmonod, no worries! Hope this was a good break 🤗 ! Sure, let me know if you need anything. |
Allow me to fix this:
#170
Note I couldn't run the
PHPUnit
in a clean env like the CI.Greetings to everyone in Lausanne 👋🏼 💚