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
Move to default branch #7231
base: master
Are you sure you want to change the base?
Move to default branch #7231
Conversation
@pelikhan what is pending in this PR? |
Backend need to be able to pull the default branch when not specified. Switch template to use "main" be default? Otherwise lots of testing. |
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.
When we load a configuration from the cloud, we don't know the default branch. The could should support a tag called "default" and use "master" or "main" as needed.
export function isDefaultBranch(branch: string, repo?: GitRepo) { | ||
if (repo && repo.defaultBranch) | ||
return branch === repo.defaultBranch; | ||
return /^(main|master)$/.test(branch); |
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.
Dubious...
const defaultBranch = pxt.github.isDefaultBranch(branch) | ||
const latest = defaultBranch ? "latest" : "git-" + branch | ||
// upload locs on build on default or releases | ||
const apiStringBranchRx: (t: string) => boolean = ((t:string) => new RegExp(pxt.appTarget.uploadApiStringsBranchRx).test(t)) |
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.
const apiStringBranchRx: (t: string) => boolean = ((t:string) => new RegExp(pxt.appTarget.uploadApiStringsBranchRx).test(t)) | |
const apiStringBranchRx: (t: string) => boolean = ((t: string) => new RegExp(pxt.appTarget.uploadApiStringsBranchRx).test(t)) |
to make the linter happy
We shouldn't assume that master is the default branch. Cleaning up to remove this assumption.