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

Split main and dev branch #142

Closed
nichtich opened this issue Nov 13, 2023 · 11 comments
Closed

Split main and dev branch #142

nichtich opened this issue Nov 13, 2023 · 11 comments
Assignees
Labels
dependencies Pull requests that update a dependency file enhancement
Milestone

Comments

@nichtich
Copy link
Collaborator

Current development is all on the main branch, leading to several instable commits. Latest stable version of our installation is 5d4b558 but I did breaking commits to the main branch in the past. Development should be moved to a dev branch which is merged into main only after testing the new feature. The main branch should further be secured against manual commits.

@pkiraly
Copy link
Owner

pkiraly commented Nov 13, 2023

I agree, but I do not know the exact details. I participated in a project called Dataverse. To contribute to the source you can not commit directly to the repo, you have to fork, and submitt a pull request, which the maintaners evaluate and if everything works well, they merge it to the developer branch.
We should work on a Git workflow with concrete git commands both how to contribute, how to merge to the dev and how to merge from dev to main. I guess the dev will not be always free of bugs, so in that we have to pick which commits works and leave those which are not perfect. Should we introduce feature branch for that?
Do you have a good document in mind to follow?

@nichtich
Copy link
Collaborator Author

nichtich commented Nov 13, 2023

The simple approach for a limited number of developers is to use the dev branch togteher as before (and possibly work on dedicated feature branches for new things). From time to time merge dev into main after testing. Bonus points for manually updating a CHANGELOG.md with a short summary of changes when doing so. Basically main includes tested releases while dev can also contain changing things that may break your local instance.

@pkiraly
Copy link
Owner

pkiraly commented Nov 13, 2023

I made the main branch restricted on Github. The develop branch is now in sync with main. Push changed into that branch. Let's see how it works.

@pkiraly pkiraly self-assigned this Nov 13, 2023
@pkiraly pkiraly added enhancement dependencies Pull requests that update a dependency file labels Nov 13, 2023
@pkiraly pkiraly added this to the PICA 1.3 milestone Nov 13, 2023
@nichtich
Copy link
Collaborator Author

Ok, here is an example: #145 but I should have created a feature-branch just for this issue. So I'm not sure whether pull requests and reviews are needed as strict rules as this is additional work for such small things (it's different for larger features, involving multiple commits). Just forced commits should be forbidden.

@pkiraly
Copy link
Owner

pkiraly commented Nov 14, 2023

I changed the settings for the branch protecting rules, now I unclicked all the checks (forced commits -- whatever it means -- are not allowed by default).

@nichtich
Copy link
Collaborator Author

The history looks strange. Maybe better merge without additional merge-commit as "rebase and merge" (this can be selected when merging) or with "squash and merge" (if from a feature branch, not from develop branch).

@pkiraly
Copy link
Owner

pkiraly commented Nov 20, 2023

As far as I understand main can be changed only via PR issued at the Github user interface, which adds a PR related commit message, somehow hiding the original commit messages.

@pkiraly
Copy link
Owner

pkiraly commented Nov 20, 2023

Could you please suggest concrete git commands? When I use git checkout main && git merge develop the merge will have a new commit - same way as a Pull Request merge will have one.

nichtich added a commit that referenced this issue Nov 21, 2023
As discussed at <#142>
to get a proper workflow for releases via main branch.
@nichtich
Copy link
Collaborator Author

I think the trick to how to pull current state from GitHub with --rebase. It looks like having one additional merge-commit on main will trigger the next, so I've merged back the existing merge-commits from main into develop. Now this should work to merge current develop into main:

git checkout main && git pull --rebase && git merge develop && git checkout develop

To simplify this, I've extended composer.json in a feeature branch (please do a squashed merge, if merging this feature branch into develop or just comment). We do this workflow in coli-conc repositories with the addition of version numbers, but I have not found out how to do in composer. Version numbers are just git tags, so the full command would be:

"release": [
      "git checkout develop && git pull",
      "@test",
      "git tag $NEW_VERSION",
      "git push",
      ...

I'd prefer auto-incrementing version numbers, we can add version numbers later into this workflow to do something like:

composer release-patch # merge develop into main and increment patch number
composer release-minor # merge develop into main and increment minor number
composer release # merge develop into main without adding a new version number (use `git tag` by hand instead)

pkiraly pushed a commit that referenced this issue Nov 21, 2023
* Add composer release command

* Add composer release script

As discussed at <#142>
to get a proper workflow for releases via main branch.
@pkiraly
Copy link
Owner

pkiraly commented Nov 21, 2023

squash and merge works. It did not add the "merge" commit.

@nichtich
Copy link
Collaborator Author

please keep and mind squash and merge can only be used when merging from a feature-branch or pull request (e.g. a throw-away branch never to be reused). I sometimes use it when testing things out locally in a temporary branch.

Anyway this issue is resolved!

pkiraly added a commit that referenced this issue Nov 26, 2023
* Release via composer (#154)

* Add composer release command

* Add composer release script

As discussed at <#142>
to get a proper workflow for releases via main branch.

* Remove local file translate.sh

* Save and show version number

* composer.json: alow existing non-owned directories

* Don't show frontend version if unknown

* Don't show frontend version if unknown

* composer: allow existing directories on install

* completeness tab: add "filter" subheading

* Extend German translation

* completeness: don't show internal package id

* completeness: don't show internal package id

* Rely on PHP autoloading (#158)

Requires to run 'composer update' or 'composer dump-autoload' once.

* Rewrite Configuration class

This fixes #161 by giving more precise error messages on invalid
configuration.

* Introduce basic test of configuration file

This starts #143 and closes #161 (see tests/files/invalid*).

* Fix typo in README

* Downgrade psr/log to 1.1, because later versions requires PHP 8.x

---------

Co-authored-by: Jakob Voß <voss@gbv.de>
pkiraly added a commit that referenced this issue Mar 5, 2024
* Release via composer (#154)

* Add composer release command

* Add composer release script

As discussed at <#142>
to get a proper workflow for releases via main branch.

* Remove local file translate.sh

* Save and show version number

* composer.json: alow existing non-owned directories

* Don't show frontend version if unknown

* Don't show frontend version if unknown

* composer: allow existing directories on install

* completeness tab: add "filter" subheading

* Extend German translation

* completeness: don't show internal package id

* completeness: don't show internal package id

* Rely on PHP autoloading (#158)

Requires to run 'composer update' or 'composer dump-autoload' once.

* Rewrite Configuration class

This fixes #161 by giving more precise error messages on invalid
configuration.

* Introduce basic test of configuration file

This starts #143 and closes #161 (see tests/files/invalid*).

* Fix typo in README

* Downgrade psr/log to 1.1, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade doctrine/instantiator (dependency of phpunit), because later versions requires PHP 8.x

* Update Biblioteca Nacional de Portugal configuration

---------

Co-authored-by: Jakob Voß <voss@gbv.de>
pkiraly added a commit that referenced this issue Mar 5, 2024
* Release via composer (#154)

* Add composer release command

* Add composer release script

As discussed at <#142>
to get a proper workflow for releases via main branch.

* Remove local file translate.sh

* Save and show version number

* composer.json: alow existing non-owned directories

* Don't show frontend version if unknown

* Don't show frontend version if unknown

* composer: allow existing directories on install

* completeness tab: add "filter" subheading

* Extend German translation

* completeness: don't show internal package id

* completeness: don't show internal package id

* Rely on PHP autoloading (#158)

Requires to run 'composer update' or 'composer dump-autoload' once.

* Rewrite Configuration class

This fixes #161 by giving more precise error messages on invalid
configuration.

* Introduce basic test of configuration file

This starts #143 and closes #161 (see tests/files/invalid*).

* Fix typo in README

* Downgrade psr/log to 1.1, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade doctrine/instantiator (dependency of phpunit), because later versions requires PHP 8.x

* Update Biblioteca Nacional de Portugal configuration

* fetch the UNIMARC Avram schema #166

* adapt data to UNIMARC #169

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

---------

Co-authored-by: Jakob Voß <voss@gbv.de>
pkiraly added a commit that referenced this issue Mar 5, 2024
* Release via composer (#154)

* Add composer release command

* Add composer release script

As discussed at <#142>
to get a proper workflow for releases via main branch.

* Remove local file translate.sh

* Save and show version number

* composer.json: alow existing non-owned directories

* Don't show frontend version if unknown

* Don't show frontend version if unknown

* composer: allow existing directories on install

* completeness tab: add "filter" subheading

* Extend German translation

* completeness: don't show internal package id

* completeness: don't show internal package id

* Rely on PHP autoloading (#158)

Requires to run 'composer update' or 'composer dump-autoload' once.

* Rewrite Configuration class

This fixes #161 by giving more precise error messages on invalid
configuration.

* Introduce basic test of configuration file

This starts #143 and closes #161 (see tests/files/invalid*).

* Fix typo in README

* Downgrade psr/log to 1.1, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade doctrine/instantiator (dependency of phpunit), because later versions requires PHP 8.x

* Update Biblioteca Nacional de Portugal configuration

* fetch the UNIMARC Avram schema #166

* adapt data to UNIMARC #169

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

* UNIMARC: adapt completeness #168

---------

Co-authored-by: Jakob Voß <voss@gbv.de>
pkiraly added a commit that referenced this issue Mar 5, 2024
* Release via composer (#154)

* Add composer release command

* Add composer release script

As discussed at <#142>
to get a proper workflow for releases via main branch.

* Remove local file translate.sh

* Save and show version number

* composer.json: alow existing non-owned directories

* Don't show frontend version if unknown

* Don't show frontend version if unknown

* composer: allow existing directories on install

* completeness tab: add "filter" subheading

* Extend German translation

* completeness: don't show internal package id

* completeness: don't show internal package id

* Rely on PHP autoloading (#158)

Requires to run 'composer update' or 'composer dump-autoload' once.

* Rewrite Configuration class

This fixes #161 by giving more precise error messages on invalid
configuration.

* Introduce basic test of configuration file

This starts #143 and closes #161 (see tests/files/invalid*).

* Fix typo in README

* Downgrade psr/log to 1.1, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade doctrine/instantiator (dependency of phpunit), because later versions requires PHP 8.x

* Update Biblioteca Nacional de Portugal configuration

* fetch the UNIMARC Avram schema #166

* adapt data to UNIMARC #169

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

* UNIMARC: adapt completeness #168

* Backport enum to PHP 7.4

* Rename utils to Utils

---------

Co-authored-by: Jakob Voß <voss@gbv.de>
pkiraly added a commit that referenced this issue Mar 5, 2024
* Release via composer (#154)

* Add composer release command

* Add composer release script

As discussed at <#142>
to get a proper workflow for releases via main branch.

* Remove local file translate.sh

* Save and show version number

* composer.json: alow existing non-owned directories

* Don't show frontend version if unknown

* Don't show frontend version if unknown

* composer: allow existing directories on install

* completeness tab: add "filter" subheading

* Extend German translation

* completeness: don't show internal package id

* completeness: don't show internal package id

* Rely on PHP autoloading (#158)

Requires to run 'composer update' or 'composer dump-autoload' once.

* Rewrite Configuration class

This fixes #161 by giving more precise error messages on invalid
configuration.

* Introduce basic test of configuration file

This starts #143 and closes #161 (see tests/files/invalid*).

* Fix typo in README

* Downgrade psr/log to 1.1, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade doctrine/instantiator (dependency of phpunit), because later versions requires PHP 8.x

* Update Biblioteca Nacional de Portugal configuration

* fetch the UNIMARC Avram schema #166

* adapt data to UNIMARC #169

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

* UNIMARC: adapt completeness #168

* Backport enum to PHP 7.4

* Rename utils to Utils

* Backport enum to PHP 7.4

---------

Co-authored-by: Jakob Voß <voss@gbv.de>
pkiraly added a commit that referenced this issue Mar 5, 2024
* Release via composer (#154)

* Add composer release command

* Add composer release script

As discussed at <#142>
to get a proper workflow for releases via main branch.

* Remove local file translate.sh

* Save and show version number

* composer.json: alow existing non-owned directories

* Don't show frontend version if unknown

* Don't show frontend version if unknown

* composer: allow existing directories on install

* completeness tab: add "filter" subheading

* Extend German translation

* completeness: don't show internal package id

* completeness: don't show internal package id

* Rely on PHP autoloading (#158)

Requires to run 'composer update' or 'composer dump-autoload' once.

* Rewrite Configuration class

This fixes #161 by giving more precise error messages on invalid
configuration.

* Introduce basic test of configuration file

This starts #143 and closes #161 (see tests/files/invalid*).

* Fix typo in README

* Downgrade psr/log to 1.1, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade phpunit to 9.6, because later versions requires PHP 8.x

* Downgrade doctrine/instantiator (dependency of phpunit), because later versions requires PHP 8.x

* Update Biblioteca Nacional de Portugal configuration

* fetch the UNIMARC Avram schema #166

* adapt data to UNIMARC #169

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

* adapt data to UNIMARC #169: implement human labels

* UNIMARC: adapt completeness #168

* Backport enum to PHP 7.4

* Rename utils to Utils

* Backport enum to PHP 7.4

* Backport enum to PHP 7.4

* Backport enum to PHP 7.4

---------

Co-authored-by: Jakob Voß <voss@gbv.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants