How does Makecode handle GitHub username migrations

I’m thinking of changing my username on GitHub to match my username elsewhere, but I’m worried about the possible ripple effect it may cause. How does makecode handle this? I mean that in the context of my account link, my projects linked to my repositories but most importantly, in the context of dependencies. Does makecode download dependenices into a project when they’re imported or does it pull them from github? Because if it’s the latter, every project that imports my extensions would break, including my own. @richard please help :pray:

5 Likes

:slight_smile:

After you change your username, GitHub will automatically redirect references to your repositories.

Web links to your existing repositories will continue to work. This can take a few minutes to complete after you make the change.
Command line pushes from your local repository clones to the old remote tracking URLs will continue to work.
If the new owner of your old username creates a repository with the same name as your repository, that will override the redirect entry and your redirect will stop working. Because of this possibility, we recommend you update all existing remote repository URLs after changing your username…


By the way, if anyone changes their username, I would appreciate it if you notify me so I can update it on Awesome Arcade. :grin:

3 Likes

What would happen if somebody imported eg. S0m3randomguy/extension before the migration, and then imported sargedev/extension after the migration? Would that override the old extension (granted that they share the same namespace and exported functions). That would be the desired outcome

3 Likes

@Sarge as far as makecode is concerned, they are completely different extensions at that point. I don’t think GitHub has a way for us to detect when usernames change on their service and even if they do we definitely don’t do anything like that today.

In the scenario you give, the project would have two extensions in it and they would probably collide/break in many places. That being said, I don’t think too many people would actually try to add the same extension on top of itself like that.

2 Likes

@richard Yes, but that’s when the issue of me updating an extension that was made under my old username with my new username arises. How would I do this? Because there are certain extensions I want to work on, and I don’t want to force people to switch to js, uninstall the old extension, removing all blocks of the extension in the process and add the new version under the new username just to recieve an update.

2 Likes

@Sarge I’m afraid there’s no workaround here except keeping your old username.

Eh, I suppose I’ll just change it and weather the storm because I don’t want to be stuck with this one. Time to go tell everyone to remove my old extensions, yay…

@richard, one final question: If an extension is imported into a project, and the repository of the extension is deleted, does the extension become inaccessible or is it cached per project somehow?

2 Likes

It is not cached per project, but it is cached in the browser. Still, it would eventually get kicked out of the cache so I would not rely on that behavior.

2 Likes

What about games that have been shared with a link? They’re compiled, so they should work forever, right?

2 Likes

@Sarge I really have no idea what will happen here, this situation has never really come up before.

You can test it out yourself, though. Create a throwaway extension repo, share a project that uses it, then delete the repo.

I think it might still work fine.

In any case, I’m interested in knowing the result.

1 Like

Would you look at that, not only does it work in a shared project, after deleting the repository MakeCode seems to make a local copy of the code in the project I imported the extension in!

image

As you can gather from the photo, the usual sync button is gone, because the repo is too, but this means not only will games published with my extensions break, neither will projects. Projects that use my old extensions will be forced to remove the old extensions if they want to update though. This is a big find! Hooray!

4 Likes