Anyone online now help me with Github PR on my repository?

Anyone please, how do I deal with a substantial pull request I have made on my own repository (Microbit extension) just now with several days’ work? Where is the button on Github that says “commit all these changes as submitted”?

On Github on the PR page, it will have something like this:

the green button that says ‘merge’ is what you want.

(depending on your settings, it might say something else, like ‘Create a merge commit’)

I have a conflict in the Readme file which is absurd as it’s only a couple of lines whereas the extension.ts has several hundred. I can’t see how to deal with this so that I can progress to the next step.

If that’s the case, then the two branches (the master branch of the repository, and the branch made for the PR) got out of sync and both editted the readme file (if there’s only a few lines, then this is actually more likely; any changes will be right next to eachother and conflict).

There should be a button on there that says something to the effect of ‘resolve conflicts’; can you point me to the PR real quick and I see what happened?

There’s only one pull request. I really don’t care about the readme file but I want to commit the virtually complete rewrite of scrollbit.ts

Ah, so on master there are a few commits with readme changes to add annotations to the snippets, and similar changes in the PR. Here’s how you can resolve them:

Click the Resolve conflicts button to the right of This branch has conflicts that must be resolved

It’ll take you to the github file editor with sections like this – the ones that have <<<<<< stuff >>>>>> with the left border in red over several lines are the conflicting portions. Choose one of the two options / versions of the line (separated by ====== and delete the rest of that stuff – it looks like it will just be a bunch of the ```blocks annotations, so just delete all but one line in that section. Then click the mark as resolved / merge buttons in the top right:

1 Like

Ah, thank you. I clicked on the “web editor” link in small type in the conflict warning. It didn’t seem to work the first time but now the “mark as resolved” is not greyed-out so I can click it…

It now presents me with the “commit merge” green button. So all will be well if I press that and my rewrite of the scrollbit.ts will be commited?

And after that, I am presented with the green “merge pull request” button…

Commit Merge will add a commit to the branch that brings it up to date, the merge pull request button will update master / the main branch with the changes

But when it says "You’re all set—the pr-84271ca0 branch can be safely deleted. " I’ll wait until I see the changes appear in the Makecode editor.

I assume I need to click on the “sync with Github” button to get hold of the update.

Yup, that’ll pull the changes down. Took a quick scan through and it looks good now, few conflict markers remaining though so I put up a PR to fix those and it should be good ~

We should have conflict resolution in MakeCode itself… but I guess there is no button to Merge master into the PR

1 Like

When I tried “sync” it was scary, because Makecode had reverted to the previous master after forcing the pull request to Github. When it asked if I wanted to commit changes I thought it would try to undo everything I had just commited. So I deleted the project which was the extension.

But this meant that the game code which used the extension would not load back into the editor - it just hung up. I should have deleted the extension from the game code first before removing the extension project. So I deleted the game and started again (I had a copy of it in Notepad++ so I could paste it back again).

Perhaps the editor needs to be able to resolve deleted local copies of extensions this without hanging up?

Thanks for all the help, I think I’m OK now.

Yeah doing this within the editor would be very nice, GitHub conflict view is nice but it’s not obvious how to use it if you haven’t been around for it / dealt with merge conflicts a bit.

I’ve been around a bit, but not in that particular location…

1 Like

If you had committed it would have been fine - we’re pretty careful about preserving history, so all things we do (besides maybe initializing the repo) is done with just normal pushes / pulls - you can use the history button to push a new commit with a revert, but everything will persist in the history / your code will remain on github no matter what you do in makecode.

Definitely should fix the bug with local repos, to clarify it was just delete the extension project while having a test project -> open test project -> crash?

I used to be a microprocessor engineer at ARM but it’s a long time since I got my head into anything technical apart from learning PHP to do my jazz band website and a bit of home electronics. The learning curve for complex suites of tools is a bit frustrating at times.

1 Like

We have a complex tool chain to make it look easy. You’ll be interested to look at the built/binary.asm file after a native build of arcade where you can read ARM thumb assembly code.

This is a great feedback. We should probably hide the pull request button until we can handle the merge entirely in MakeCode (and handle conflicts)