-
Notifications
You must be signed in to change notification settings - Fork 31
Fix miscellaneous ci issues #78
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
Conversation
|
@aminya I can move the |
|
Thank you! will check this later today. |
f0ab74d to
6235a14
Compare
| ? process.env.NIGHTLY_RELEASE_REPO | ||
| : 'atom-nightly-releases'; | ||
|
|
||
| const yargs = require('yargs'); |
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.
Is there a reason that MAIN_REPO is missing here? Just want to check if we haven't missed it.
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.
The script authors didn't use "the name of the main repo" anywhere in the script. I suppose they had no need for it.
(Where they use the string 'atom', they mean "the repo owner"; the org/user whose account the [nightly] repo is under.)
And the linter gets upset if you define a variable and don't use it.
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 is the only place in the file any of these vars is needed.
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.
By the way, from reading that line, it appears if our Nightly repo goes stale, and lacks recent tags, our auto drafts of releases (if we use that feature) will not advance their version number. So we would perhaps have to manually fix the suggested version number?
Something to keep in mind. Some of Atom's release CI steps are very interconnected with the Nightly repo.
| displayName: Cache node_modules | ||
| inputs: | ||
| key: 'npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | package.json, package-lock.json, script/vsts/platforms/${{ parameters.OS }}.yml' | ||
| key: 'npm_pr_78 | "$(Agent.OS)" | "$(BUILD_ARCH)" | package.json, package-lock.json, script/vsts/platforms/${{ parameters.OS }}.yml' |
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.
What is this?
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.
That should be removed before this would be merged.
That's setting the cache aside for this PR so it doesn't pull anything in from master branch, or even earlier commits of the PR. Nothing else has that cache key value, so there is no existing cache to hit.
I was seeing weird errors, so rather than spend time debugging them, I wanted to see if they went away when cache restoring was disabled.
Next step is to remove that and see if it passes CI when restoring cache from the general pool (e.g. from master) is enabled again.
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.
Please revert this. If there is a problem with caching we need to fix that instead of monkey patching.
| npm install | ||
| displayName: Install Windows build dependencies | ||
| condition: eq(variables['Agent.OS'], 'Windows_NT') | ||
| condition: and(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['buildArch'], 'x86')) |
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 is incorrect.
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.
I would like us to consolidate these variables.
buildArch is set and then BUILD_ARCH is set equal to buildArch. As far as I can tell, this is unnecessary; Only variables set from Azure DevOps UI need to be UPPERCASE_WITH_UNDERSCORES. Since these are set in yaml, they may be camelCase.
As far as I can tell:
buildArchandBUILD_ARCHare only set on Windows (x86 and x64)buildArchandBUILD_ARCHare always available on Windows, whether as Azure DevOps variables, or as environment variablesbuildArchandBUILD_ARCHhold the same value at any given moment
Therefore, I'd like us to pick one and settle on it so we can be consistent and make the CI less confusing. No need to have two different variables for the exact same value if one is good enough.
One thing to note: script/vsts/windows-run.js looks for BUILD_ARCH (capital case with underscores), so we need to standardize on that, OR edit the script to look for process.env.buildArch instead of process.env.BUILD_ARCH.
It would be a big priority for me to consolidate these due to the unnecessary complexity and confusion.
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.
And in case that's not what you mean, how is it incorrect?
One of my goals in this PR was to make sure the script/vsts/node_modules dependencies, and windows-run.js, are totally not needed for Windows x64.
(Just like they're not needed on macOS or Linux. It should only be needed on Windows x86, to support windows-run.js -- and even then, probably the native Node API is enough to accomplish what is needed in windows-run.js if we refactor it a bit.)
If I recall correctly, the only thing still not working is the "Upload crash reports" under Windos x64, which I suppose is still a blocker, because I don't think upstream will merge if that's broken.
If need be, I can give up on eliminating windows-run.js on Windows x64. It did turn out to be more complicated than expected.
In that case, we should still switch cd script/vsts && npm install to cd script/vsts && npm ci to be slightly faster. (We don't cache those dependencies, so there is no downside to ci vs install).
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.
If this step is only needed for x86 that makes sense. You should rename the display name and comment as well then to be specific to x86
| - job: Windows_build | ||
| displayName: Windows build |
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.
Please revert this. Make it Windows to keep it simple. It is still called Windows on upstream.
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.
I was copying the macOS build job label that upstream uses for macOS, where the CI is split up between a "build" job and a "parallel test" job. Just like we introduced for Windows at this fork.
So maybe upstream will eventually take this? I do think they want parallel testing on Windows x64. (I think they might be more likely to take it if it is separated out from the "move lots of stuff to templates" changes. But I'm not them so I can't read their minds about that. It would be most welcome if they would comment on our PR.)
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 job is called on other files too like Release job. After all, it is just a name, I don't think it is important. 😄 If you want to change it you change it everywhere.
| displayName: Windows | ||
| dependsOn: Windows_build |
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.
Please revert this.
|
I will take your feedback into consideration and try to decide what to do. Some things are subjective, like job names, but still, good decisions make the CI nicer to use and work with. Strongly considering moving the "no install That said, future me may have a different opinion on this... Just laying out my thoughts while I have enough time to think about this but not act on it just yet. |
| displayName: Cache node_modules | ||
| inputs: | ||
| key: 'npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | package.json, package-lock.json, script/vsts/platforms/${{ parameters.OS }}.yml' | ||
| key: 'npm_pr_78 | "$(Agent.OS)" | "$(BUILD_ARCH)" | package.json, package-lock.json, script/vsts/platforms/${{ parameters.OS }}.yml' |
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.
Please revert this. If there is a problem with caching we need to fix that instead of monkey patching.
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.
Once you applied the requested changes, I will merge this into our upstream PR (cross-platform CI).
|
This needs a closer look on the Windows x86 stuff. Last I recall I was going to push that out to a separate PR. I also noticed the "script step inexplicably exits after There might be a couple other things I notice here and there that can be tidied up over time even after this PR is merged. |
78e43c4 to
4ba8303
Compare
|
I prefer that you revert skipping |
This comment has been minimized.
This comment has been minimized.
22f2d83 to
23c5e74
Compare
|
Getting rid of ALL_CAPS |
23c5e74 to
02f8d9b
Compare
|
I'd also like to get rid of the explicit Python 3 install in Windows (because it wastes time), instead relying on the already-installed Python versions. We pinned npm to an older version that can't use Python 3 anyhow, during the Electron 6 PR. 😢 Not a big deal though. |
This should be a separate PR. Please keep this just a bug fix. |
02f8d9b to
80990ce
Compare
This comment has been minimized.
This comment has been minimized.
Also make sure "Release" job depends on successful Windows tests, not just on the Windows build job, before/regardless of testing.
We no-longer run the Linux build in an old Ubuntu 14.04 "Trusty Tahr" Docker container. We run builds directly in a virtualized Ubuntu 16.04 "Xenial Xerus" image now.
Using the `env:` yaml key is not actually needed unless the variables
contain secret/sensitive information. (These varibales won't
have sensitive content, just a repo owner and some repo names).
These environment variables would expand to literally `${VAR_NAME}`,
rather than to an empty string, if not explicitly set in Azure DevOps.
This would make consuming the variables in JavaScript unnecessarily
awkward.
Instead, we can set reasonable defaults if the variables are falsy
(i.e. unset or null in our case), and otherwise override with what's
manually set in the environment variables.
REPO_OWNER, MAIN_REPO, and NIGHTLY_RELEASE_REPO now default to 'atom', 'atom' and 'atom-nightly-releases', respectively.
Co-authored-by: Amin Yahyaabadi <[email protected]>
This old bug in the CI inexplicably went away at some point.
80990ce to
cfd4a0b
Compare
|
Force pushed to update the first commit, where I had missed the Release job of the nightly pipeline yml, |
|
That's why I said keep the names as before. Now you need to change |
|
I fixed it. All of them are properly updated. Here's a commit (which I haven't added to this PR) that I mocked up to make the Windows yml more similar to the macOS one. If you like it I'll push it here, but I left it out for now. I like that it's consistent, so you don't have to memorize two different sets of naming conventions and ordering of the yaml. Reading one shows you mostly how the other one is set up. Edit to add: The "windows" display name for the Windows tests, as I added in this PR, doesn't make sense. It should at least have "test" in the name. The commit I linked in this comment has "test" in the name for the Windows test job. See this CI run, with reasonable/human-friendly display names for all the jobs: https://dev.azure.com/DeeDeeG/b/_build/results?buildId=260&view=results |
|
Upstreamable commits:
|
|
cfd4a0b does make GetReleaseVersion fail to print the version it finds sometimes. That must be what the old error message was about. I have only seen this on the Pull Requests pipeline, where GetReleaseVersion is not important. And I have a suspicion that the script may actually be running and its output just isn't being displayed, as an Azure DevOps bug. In any case, I have seen no issues in those cases where we can't see any output of GetReleaseVersion. Let's look at that carefully before we submit it to upstream. If there are problems, we may need to revert. I never saw it skip outputting a version on several runs of the Nightly Release pipeline, nor during the Release Branch Build pipeline. Still something to look out for in case it does happen and I just didn't do it enough times to reproduce it yet. |
|
There's more to do on the REPO vars, so I'd like a chance to do that and we can submit it all in one go? I opened #83 for this. I don't think it's hard; predominantly just sifting through the code for hard-coded strings and replacing them with the right |
Requirements for Contributing a Bug Fix (from template)
Identify the Bug
Fixes most of #70
Description of the Change
Update Windows job names.
Windows-->Windows_buildmakes it more obvious this job simply builds Windows, nothing more.Windows_RendererTestsnow depend onWindows_build, notWindows.Releasenow depends onWindows_RendererTests, notWindows.Delete a comment about containers in Linux preparation
Set fallback/default values for the
REPOmetadata variables:REPO_OWNER-->'atom';MAIN_REPO-->'atom';NIGHTLY_RELEASE_REPO-->'atom-nightly-releases'Delete an old workaround that's no longer applicable, with
npm installin a scrfipt block, immefiately followed by another script blocknpm install", so just combine the two adjacent script blocks.Alternate Designs
Not fix these (admittedly minor) issues?
Possible Drawbacks
None that I know of. Watch to make sure that deleting
cd script/vsts && npm installon Windows doesn't somehow cause problems.Watch to make sure I didn't typo the job names under Windows.
Verification Process
CI should pass. Reviewing the diff should confirm there are no typos in the PR.
Release Notes
N/A