Stream: github
Topic: Push to R4B
Rik Smithies (Feb 11 2021 at 10:50):
I am getting errors trying to update the branch, as below. I have got the main build, done a pull to update it to the R4B branch (as in thread above, which seemed to work), made some changes, and now I am trying to push back (using tortoise to do a push on the folder). Do I need to push with a branch specific command?
git.exe push --progress "origin" R4B:R4B
Enumerating objects: 40, done.
Counting objects: 100% (32/32), done.
...
remote: This repository moved. Please use the new location:
remote: https://github.com/HL7/fhir.git
remote: error: GH006: Protected branch update failed for refs/heads/R4B.
remote: error: 2 of 2 required status checks are expected. At least 1 approving review is required by reviewers with write access.
To https://github.com/hl7/fhir
! [remote rejected] R4B -> R4B (protected branch hook declined)
error: failed to push some refs to 'https://github.com/hl7/fhir'
git did not exit cleanly (exit code 1) (5312 ms @ 11/02/2021 10:43:21)
Mark Iantorno (Feb 11 2021 at 15:26):
The branch is protected. To make changes you need to open a pull request, and that pull request must build successfully before you can push changes.
Josh Mandel (Feb 11 2021 at 15:27):
(Or.before you can *merge changes into r4b)
Mark Iantorno (Feb 11 2021 at 15:27):
R4B is treated just like master, it is considered a 'live' version of the spec that people are actively using, so we need to perform checks everytime the code is changed. Otherwise, you could break the website for everyone (like I did yesterday).
Mark Iantorno (Feb 11 2021 at 15:28):
if you need assistance in creating a pull request, please look at these two articles here:
Mark Iantorno (Feb 11 2021 at 15:28):
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests
Mark Iantorno (Feb 11 2021 at 15:28):
Mark Iantorno (Feb 11 2021 at 15:28):
if after going through those, it still doesn't make sense, let me know, and I will have a call with you and we can work through creating a pull request (PR)
Rik Smithies (Feb 11 2021 at 18:41):
ok I will go read that thanks. I am curious why this needs to be different from the main build though? Its not as if we want people breaking that one. It does a build when stuff is pushed and rejects breaking changes. So unless you are deep in the weeds tweaking pipelines etc, how would my build-passing changes break it? Is it just that we need manual review of all changes to R4B?
Mark Iantorno (Feb 11 2021 at 18:45):
This prevents any "it works on my machine" errors.
Mark Iantorno (Feb 11 2021 at 18:45):
If we trusted everyone to build on their own local machine everytime they commit, and that their machine is the exact same as everyone elses, then we wouldn't need the CI at all.
Mark Iantorno (Feb 11 2021 at 18:46):
We rebuild the spec on a generic build machine in the cloud that ensure the build is stable and repeatable. That way we have a 'source of truth'
Mark Iantorno (Feb 11 2021 at 18:47):
I should be the same process as the main branch though?
Mark Iantorno (Feb 11 2021 at 18:48):
you create your own branch, do a PR against the branch you want to merge into, and if the CI passes, you can merge. How are you finding it different?
Mark Iantorno (Feb 11 2021 at 18:48):
If there is a workflow issue, I can make changes?
Rik Smithies (Feb 11 2021 at 22:27):
@Mark Iantorno With the main build I can do a push and it goes into the build. I go to the web page and do a pull request. It checks it and eventually it says its mergeable and in it goes. With R4B, the push simply fails, as above. (remote: error: GH006: Protected branch update failed for refs/heads/R4B.)
Mark Iantorno (Feb 11 2021 at 22:29):
The main branch requires the same checks to pass as R4B? You should not be able to push directly to the main branch without opening a pull request? If you are...then something is wrong...and we should fix that
Mark Iantorno (Feb 11 2021 at 22:29):
Yeah I just checked, not even I can push directly to the master branch
Mark Iantorno (Feb 11 2021 at 22:30):
If you are able to, please let me know. That should not be happening. The process is to open a pull request and have the checks run.
Mark Iantorno (Feb 11 2021 at 22:30):
The process should be identical for R4B and Master
Rik Smithies (Feb 11 2021 at 22:30):
there is no problem with the main branch. I dont go "direct", that is not what I was describing above
Mark Iantorno (Feb 11 2021 at 22:31):
With the main build I can do a push and it goes into the build
I don't understand what you mean by this then
Rik Smithies (Feb 11 2021 at 22:32):
well I push, and it goes up to somewhere :-)
Rik Smithies (Feb 11 2021 at 22:32):
then I pull and it works
Mark Iantorno (Feb 11 2021 at 22:32):
Yeah, so you create a branch I assume?
Mark Iantorno (Feb 11 2021 at 22:32):
and the PR goes from branch -> master
Mark Iantorno (Feb 11 2021 at 22:33):
the same flow should occur for R4B
Rik Smithies (Feb 11 2021 at 22:33):
on main, yes
Mark Iantorno (Feb 11 2021 at 22:33):
you would create a branch
Rik Smithies (Feb 11 2021 at 22:33):
I think the issue for R4b is that I need a branch on my r4b branch
Mark Iantorno (Feb 11 2021 at 22:33):
then the PR goes from branch -> R4B
Mark Iantorno (Feb 11 2021 at 22:33):
treat R4B like another master
Rik Smithies (Feb 11 2021 at 22:34):
I thought I was, but when I switched to the R4B branch, it removes my local branch I guess
Mark Iantorno (Feb 11 2021 at 22:34):
like, locally on your computer , the branch is deleted?
Rik Smithies (Feb 11 2021 at 22:34):
so I am not on a branch of the branch. if that even makes sense...
Rik Smithies (Feb 11 2021 at 22:36):
not sure if it is deleted, but I am just no longer on it it seems
Mark Iantorno (Feb 11 2021 at 22:36):
but this is locally on your computer?
Rik Smithies (Feb 11 2021 at 22:36):
yes
Mark Iantorno (Feb 11 2021 at 22:37):
okay, I think this might just be a workflow issue locally
Rik Smithies (Feb 11 2021 at 22:37):
I get the concept of "main" and I normally make a branch and work with that. But now I need to use the R4B branch, so I switch to that. Do I then make a branch on that branch?
Mark Iantorno (Feb 11 2021 at 22:37):
do you want to have a quick call tomorrow?
Mark Iantorno (Feb 11 2021 at 22:38):
I can walk you through it?
Mark Iantorno (Feb 11 2021 at 22:38):
I'm not sure what tools you are using
Mark Iantorno (Feb 11 2021 at 22:38):
so seeing your setup would help me in giving you the proper direction
Mark Iantorno (Feb 11 2021 at 22:38):
I do everything on command line so life is quite different ofr me
Rik Smithies (Feb 11 2021 at 22:40):
ok thanks for the offer, I will try to figure it out and maybe ask for a call if I cannot. but can you answer this one: If I switch to the R4B branch locally, to work on it, do I also need to create another branch, on that branch, to do so?
Mark Iantorno (Feb 11 2021 at 22:41):
yes, you would want to treat R4B the exact same way you treat master
Mark Iantorno (Feb 11 2021 at 22:41):
it's another master
Mark Iantorno (Feb 11 2021 at 22:41):
except for R4B
Rik Smithies (Feb 11 2021 at 22:41):
that is what I had not appreciated
Mark Iantorno (Feb 11 2021 at 22:41):
Master is the 'master' for all the other versions
Mark Iantorno (Feb 11 2021 at 22:41):
R4B is the 'master ' for R4B
Mark Iantorno (Feb 11 2021 at 22:42):
I should probably write this all up for people
Mark Iantorno (Feb 11 2021 at 22:42):
I'll carve some time out tomorrow for docs
Rik Smithies (Feb 11 2021 at 22:42):
well I had not considered it. I was on my branch (of main) working fine, switched to R4B, then did not think to make a branch on the "branch of R4B". So when I push it fails.
Mark Iantorno (Feb 11 2021 at 22:44):
No worries at all. Let me know if you do need assistance tomorrow.
Rik Smithies (Feb 11 2021 at 22:45):
thanks Mark
Rik Smithies (Feb 12 2021 at 11:08):
I managed to push my changes, but the pull request hasn't got anywhere.
https://github.com/HL7/fhir/pull/1096#issue-572187169.
It said that it cannot be merged automatically. I am not sure if that is due to something in my changes or because its coming after some other changes. The conflicts involve lots of files that I have not touched e.g. gradlew.bat (unless something very strange happened in my push).
It is also saying "Some checks haven’t completed yet
1 expected check
Pull Request Pipeline (buildAndPublishSpecification) Expected — Waiting for status to be reported"
Mark Iantorno (Feb 12 2021 at 14:30):
so
Mark Iantorno (Feb 12 2021 at 14:30):
right now you pulled all the changes from master into your changes for R4B
Mark Iantorno (Feb 12 2021 at 14:30):
but that won't work
Mark Iantorno (Feb 12 2021 at 14:30):
you need to treat them like completely different projects
Mark Iantorno (Feb 12 2021 at 14:31):
why don't we have a call at some point today
Mark Iantorno (Feb 12 2021 at 14:31):
I can help you out
Mark Iantorno (Feb 12 2021 at 14:31):
I can also do next week if that works better for you
Mark Iantorno (Feb 12 2021 at 14:34):
just keep in mind I have Monday and Friday off
Mark Iantorno (Feb 12 2021 at 14:34):
I'm in EST timezone
Rik Smithies (Feb 12 2021 at 16:57):
Well I do need this explaining yes, thanks. If the steps for getting the locally, creating a local branch, pushing it back and creating a pull can be documented, that would be very helpful.
What I have done to work on R4B:
I first get all of https://github.com/hl7/fhir
then I switch to the R4B "branch" (but I think this is not a branch, its another thing like master?)
git checkout R4B
I am then on the R4B branch (am I?)
I now make a local branch for my work
git checkout -b rikr4b
Then I make changes, and it builds ok and looks fine.
I commit (using windows tortoise git)
I push (using windows tortoise git, with the defaults that it shows, which is normally fine)
I go to the web page and try to create the pull, but I assume by this time it has already gone wrong.
Is it possible to edit the above to be correct?
Mark Iantorno (Feb 12 2021 at 17:01):
Do your pull request against the R4B branch and not master
Mark Iantorno (Feb 12 2021 at 17:02):
Right now you're trying to merge your personal R4B branch into master...which will cause you to get an absolute monster diff and won't build or merge
Rik Smithies (Feb 12 2021 at 17:02):
ok, so what page would I go to for that?
Rik Smithies (Feb 12 2021 at 17:03):
https://github.com/HL7/fhir/tree/R4B?
Mark Iantorno (Feb 12 2021 at 17:03):
At you last step when you create the pull request
Mark Iantorno (Feb 12 2021 at 17:03):
instead of creating the pull request to merge into master branch
Mark Iantorno (Feb 12 2021 at 17:03):
create it to merge into R4B branch
Rik Smithies (Feb 12 2021 at 17:03):
yes I understand what to do, but I dont know how to do it :-)
Mark Iantorno (Feb 12 2021 at 17:04):
Ah, when you are on the Github page to create the pull request, right at the top, you can just click on the branch names
Mark Iantorno (Feb 12 2021 at 17:04):
the to and from branches
Mark Iantorno (Feb 12 2021 at 17:04):
you can create a pull between any two branches
Rik Smithies (Feb 12 2021 at 17:06):
if I have the pull request on the wrong thing is it possible to move it to the right thing? Or do I need to start all over again
Mark Iantorno (Feb 12 2021 at 17:06):
Mark Iantorno (Feb 12 2021 at 17:06):
Mark Iantorno (Feb 12 2021 at 17:08):
it would be best to just open a new one and close the old one
Mark Iantorno (Feb 12 2021 at 17:09):
it's easy to do just hit close pull request button at the bottom of the current PR
Mark Iantorno (Feb 12 2021 at 17:09):
then create a new one
Rik Smithies (Feb 12 2021 at 17:11):
I'm ok to close that yes thanks.
I created a pull request https://github.com/HL7/fhir/pull/1097, into R4B from rikr4b2.
Rik Smithies (Feb 12 2021 at 17:13):
I now see
Merging is blocked
Merging can be performed automatically with 1 approving review.
Mark Iantorno (Feb 12 2021 at 17:37):
Yeah so once the checks pass Grahame will need to review
Mark Iantorno (Feb 12 2021 at 17:37):
I just do the plumbing, I'm not familiar enough with the standard to give you feedback of value
Last updated: Apr 12 2022 at 19:14 UTC