-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[core] Don't force a remote when listing prettier changes #18794
Conversation
My master branch is tracking upstream/master, where upstream points to https://github.com/mui-org/material-ui.git My origin/master is so far behind it breaks the `yarn prettier` command for me (stdout overflow). I propose to explictly remove the remote. Like in the script this one is based on: https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/scripts/shared/listChangedFiles.js#L29
No bundle size changes comparing ad6fe1b...4821a88 |
I have the same git configuration as you. It performs better this way, thank you for the fix! |
@oliviertassinari Are there any guidelines written down around which labels to use like |
@Janpot There isn't. From my perspective, core is about internal changes, that won't directly benefit users. |
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.
This won't work for CI. In CI branches are usually hard reset which means it can't pick up the proper merge base.
At least this was the case when we first introduced it. Either we change it to upstream/master or we debug this first e.g. log the changed files and see if the CI picks this file up properly.
My origin/master is so far behind it breaks the yarn prettier
Why not update it? You should do this either way so your branch is as close to master as possible. The farther behind your branch the more likely you encounter merge conflicts when opening a PR. I usually update my origin once or twice a week:
$ git checkout master
$ git pull upstream master
$ git push origin master
Since I run prettier in a pre-push hook I quickly notice when my local master is too far behin.
Why don't we verify this? I think we can just verify the output? I don't have access to it, but it seems to have run successfully. It also runs successfully in react CI. I'm also not aware of hard reset messing with tracking branches.
Because I don't use it, since my |
In my local env, it looks like this (4 months old 🤷♂️)
|
Not a year and a half, I seem to have synced it somewhere in the meantime 🙂 |
What should we verify?
If the list of files is empty prettier can never complain. |
The build output of the prettier command in Circle CI. It should be something like
Only, I don't have access to your Circle CI 🤷♂. In the meantime I removed a semicolon somewhere so we can verify whether it breaks the build or not. There isn't much more I can do without access to Circle CI. |
Maybe I should add a unit test for |
I'm open to any improvement. I think doing a full check on master and changed-only in a PR should be good enough to detect breakage.
What elevated permissions do you need and why? https://circleci.com/gh/mui-org/material-ui/131034 should be readable by anyone. Looking at the output the new behavior is not correct. It runs on unrelated files and not the ones introduced in this PR. |
Oh ok, I was clicking the details links in the github checks ui => https://app.circleci.com/jobs/github/mui-org/material-ui/131034 |
@eps1lon Looks like it was just a bit behind on master, after merging master in this branch, the expected files are checked: https://circleci.com/gh/mui-org/material-ui/131312 |
This shouldn't be required. Otherwise maintainers would need to check if the branch is behind. It should just run on the files listed in "files changed". |
It's not required, it's just a few unchanged files that are checked as well on top of the changed ones. That is not a problem, and it already behaves like that without my PR. If anything, I'd say keeping your branch up to date with master is good practice in most cases. Specifically, it's this commit #18780 that was merged in master after the commit where I started this 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.
It's not required, it's just a few unchanged files that are checked as well on top of the changed ones.
Let's see if this causes confusion later.
@Janpot Thanks for working on this! |
My master branch is tracking upstream/master, where upstream points to https://github.com/mui-org/material-ui.git
My origin/master is so far behind it breaks the
yarn prettier
command for me (stdout overflow).I propose to remove explicitly specifying the remote.
Like in the script this one is based on: https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/scripts/shared/listChangedFiles.js#L29