-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Implement RFC 002: Atom Nightly Releases #17538
Conversation
This change adds automation for producing nightly Atom releases using VSTS CI. Most of the changes are just slight modifications to Atom's existing build scripts to produce another build channel and publish those artifacts in a way that can be installed and updated when new releases are available.
script/config.js
Outdated
|
|
||
| function getChannel () { | ||
| if (appMetadata.version.match(/dev/)) { | ||
| if (process.env.BUILD_DEFINITIONNAME === 'Atom Nightly') { |
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 a VSTS environment variable but I'm planning to change it to something specific to Atom
script/config.js
Outdated
| const commitHash = result.stdout.toString().trim() | ||
| version += '-' + commitHash | ||
| } else if (channel === 'nightly') { | ||
| version = process.env.BUILD_BUILDNUMBER |
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'll also change this env variable to something that isn't specific to VSTS
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 looks like this uses the build number as Atom's version number. If that's the current behavior, how would you feel about changing it to append the build number to the version number (e.g., "1.30.0-nightly-42")?
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 was actually the case but it wasn't super clear since I was using VSTS' environment variable :) At this point in the code, I had configured the build to use the full 1.30.0-nightly42 version as the "build number". I've since changed it to use a more Atom-specific environment variable that gets set in the VSTS YAML config.
|
|
||
| module.exports = (packagedAppPath) => { | ||
| const archSuffix = process.arch === 'ia32' ? '' : '-' + process.arch | ||
| // const archSuffix = process.arch === 'ia32' ? '' : '-' + process.arch |
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 and the other commented line below will be uncommented once atom.io changes are merged/deployed.
script/lib/create-github-release.js
Outdated
| @@ -0,0 +1,30 @@ | |||
| 'use strict' | |||
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 file wasn't supposed to make it in, will take it back out
script/vsts/nightly-release.yml
Outdated
| @@ -0,0 +1,39 @@ | |||
| name: 1.29.0-nightly$(Rev:r) | |||
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.
Need to find a way to pull this version number from package.json on master so that it doesn't need to be updated manually each time we roll the railcars
jasonrudolph
left a comment
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.
@daviwil: Thanks for getting this going. ⚡
I've included a few questions inline in the review below.
In addition to those inline questions, I have a few higher-level questions/notes:
-
What happens if I'm using the nightly release channel, and Atom's master branch hasn't had any new commits in more than 24 hours? Does a new nightly release still get created?
-
What happens if the nightly build fails for one platform and passes for the other platforms? Does the nightly release get created for the platforms where the build succeeded?
-
The task list says:
- Fix or disable tests that fail on VSTS (more info below)
I have a fairly strong preference that we fix those tests instead of disabling them. 🙏
script/config.js
Outdated
| const commitHash = result.stdout.toString().trim() | ||
| version += '-' + commitHash | ||
| } else if (channel === 'nightly') { | ||
| version = process.env.BUILD_BUILDNUMBER |
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 looks like this uses the build number as Atom's version number. If that's the current behavior, how would you feel about changing it to append the build number to the version number (e.g., "1.30.0-nightly-42")?
| fs.unlinkSync(nupkgPath) | ||
| } else { | ||
| if (process.arch === 'x64') { | ||
| const newNupkgPath = `${CONFIG.buildOutputPath}/atom-x64${path.basename(nupkgPath).slice(4)}` |
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's the significance of the number 4 on this line? Could that number be extracted to a constant whose name explains the significant of the number?
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.
4 is the length of the string atom, I'm basically ripping the front part of the original filename atom-1.30.0-nightly00-full.nupkg off so that I can replace it with atom-x64 in the build output path. I've simplified the logic here and added a comment so that the intent is clearer.
script/publish-release
Outdated
| publishRelease({ | ||
| token: process.env.GITHUB_TOKEN, | ||
| owner: 'atom', | ||
| repo: CONFIG.channel !== 'nightly' ? 'atom' : 'atom-nightly-releases', |
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.
Can you remind me why it makes sense to have a separate repository for the nightly releases?
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.
Two reasons:
- atom/atom's Releases feed will get swamped with nightly releases and it'll be harder to scan through the list to find older stable/beta releases
- My goal was to use Electron's new update service for this and they use the Releases feed as the source of truth for updates. Seemed to make more sense to have it be a separate repo for now. Can always change it later!
script/vsts/linux.yml
Outdated
| steps: | ||
| - task: NodeTool@0 | ||
| inputs: | ||
| versionSpec: 8.11.3 |
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 think the current builds all use Node 6.9.4 [example]. Can you share the motivation for using Node 8.11.3 here?
I'm thinking that we'd want all builds (including the new nightly builds) using the same Node version.
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.
Mainly because we now use Node 8 inside of Electron 2.0, so it's helpful to have the same JavaScript language features (async/await, improved perf) inside our build scripts. I started off using Node 6 in the builds and saw a noticable performance increase (~10 minutes saved) by switching to 8. More recently in this PR, I switched to the exact version of node in Electron 2.0, 8.9.3.
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.
@daviwil Thanks for the insight. Can I talk you into opening a follow-up PR to replace the existing uses of Node 6 with Node 8?
Line 18 in 3109958
| env: NODE_VERSION=6.9.4 DISPLAY=:99.0 CC=clang CXX=clang++ npm_config_clang=1 |
Line 23 in 3109958
| NODE_VERSION: 6.9.4 |
Lines 20 to 21 in 3109958
| - nvm install 6.9.4 | |
| - nvm use 6.9.4 |
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.
Definitely, I'll send that out later today!
How about: Are the stars too cheesy? 😄 It's a hint for "nightly". It would also differ from the rest that only have different hues, maybe ok. I was also thinking to replace all icons and redesign them with the "portal style" from atom.io. But that could also be done in a later PR. |
|
@simurai I absolutely love that! Sure, it might be a little bit "cheesy", but 🧀 is delicious ❤️ |
|
OMG @simurai that is awesome. |
|
Love it @simurai! Definitely makes it stand out in a clear way. I think doing an icon overhaul sometime this year in the new style would also be awesome, but this icon works for now! |
Ok, let's keep it in mind, but no rush. For now I added the "purple with stars" version. |
45789f8 to
ed48f2d
Compare
daviwil
left a comment
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.
@jasonrudolph Thanks! To answer your questions:
-
Nightly builds only get kicked off if there have been changes to
masterwithin the last 24 hours. -
If any part of the build process fails on any platform, nothing gets published. The "release" phase of the build only proceeds if all 3 platform builds and their tests pass.
-
I've had to disable tests in the github and keybinding-resolver packages (only on VSTS) since they will take more time to investigate and fix. I've filed issues atom/github#1568 and atom/keybinding-resolver#60, respectively, to track the need to fix these. It turns out that they're both issues that appear on other CI platforms but VSTS happens to reproduce them more consistently.
| fs.unlinkSync(nupkgPath) | ||
| } else { | ||
| if (process.arch === 'x64') { | ||
| const newNupkgPath = `${CONFIG.buildOutputPath}/atom-x64${path.basename(nupkgPath).slice(4)}` |
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.
4 is the length of the string atom, I'm basically ripping the front part of the original filename atom-1.30.0-nightly00-full.nupkg off so that I can replace it with atom-x64 in the build output path. I've simplified the logic here and added a comment so that the intent is clearer.
|
This PR is ready for final review! If you'd like some overall context on the process, check out the documentation I wrote up here. I'm happy to continue making improvements to the code and documentation until we feel it's ready to be merged. Thanks! |
maxbrunsfeld
left a comment
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 looks great!
daviwil
left a comment
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.
Missed some other comments from Jason, sorry about that!
script/vsts/linux.yml
Outdated
| steps: | ||
| - task: NodeTool@0 | ||
| inputs: | ||
| versionSpec: 8.11.3 |
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.
Mainly because we now use Node 8 inside of Electron 2.0, so it's helpful to have the same JavaScript language features (async/await, improved perf) inside our build scripts. I started off using Node 6 in the builds and saw a noticable performance increase (~10 minutes saved) by switching to 8. More recently in this PR, I switched to the exact version of node in Electron 2.0, 8.9.3.
script/publish-release
Outdated
| publishRelease({ | ||
| token: process.env.GITHUB_TOKEN, | ||
| owner: 'atom', | ||
| repo: CONFIG.channel !== 'nightly' ? 'atom' : 'atom-nightly-releases', |
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.
Two reasons:
- atom/atom's Releases feed will get swamped with nightly releases and it'll be harder to scan through the list to find older stable/beta releases
- My goal was to use Electron's new update service for this and they use the Releases feed as the source of truth for updates. Seemed to make more sense to have it be a separate repo for now. Can always change it later!
script/config.js
Outdated
| const commitHash = result.stdout.toString().trim() | ||
| version += '-' + commitHash | ||
| } else if (channel === 'nightly') { | ||
| version = process.env.BUILD_BUILDNUMBER |
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 was actually the case but it wasn't super clear since I was using VSTS' environment variable :) At this point in the code, I had configured the build to use the full 1.30.0-nightly42 version as the "build number". I've since changed it to use a more Atom-specific environment variable that gets set in the VSTS YAML config.
|
Tests are green, issues are filed for future work. I think this is ready to be merged! Once it's in |
|
That was a ton of work. Nice job powering through 💥 ⚡️ |




Description of the Change
This change adds automation for producing nightly Atom releases using VSTS CI. Most of the changes are just slight modifications to Atom's existing build scripts to produce another build channel and publish those artifacts in a way that can be installed and updated when new
releases are available.
See Atom RFC 002 for more details.
Alternate Designs
See this section of RFC 002.
Why Should This Be In Core?
This is a new release channel for Atom Core!
Benefits
See this section of RFC 002.
Possible Drawbacks
There isn't a major downside to this effort since it would run in parallel to the existing Atom release process without affecting it.
Verification Process
Produced signed Nightly builds using CI and verified that they are updatable using Electron's update service on Windows and macOS (the only platforms that support Squirrel).
At this moment nightly builds are not auto-updating because I decided to switch back to using Atom's update service on atom.io. Updating will work again once I push a change to atom.io today or tomorrow to enable the Nightly channel.
Applicable Issues
None.
Remaining Tasks
There are a few remaining tasks that need to be finished before this PR can be merged:
atom-nightly.shandapm-nightly.sh) for Linux buildsremoteReleasesinscript/lib/create-windows-installer.jsso that Windows delta updates can be generatedFailing Tests
There are 4 tests that fail consistently on VSTS for no obvious reason:
macOS
keybinding-resolver package:
GitHub package:
GitHub package:
I'd certainly appreciate any ideas for how these issues might be diagnosed!
Future Tasks
There are other tasks that will be finished in future PRs:
I'll file issues for these when this PR is approved and merged.