-
Notifications
You must be signed in to change notification settings - Fork 30
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
CI templates #46
CI templates #46
Conversation
@DeeDeeG Because of this, we need to rebase other pull requests. So let's first merge this. |
I hope we can combine the templates, especially macOS/Linux which are both UNIX-like and use mostly the same commands. We can use conditional expressions looking at (Other than differing env vars,
7,9c7,8
< CC: clang-5.0
< CXX: clang++-5.0
< npm_config_clang: 1
---
> NPM_BIN_PATH: /usr/local/bin/npm
> npm_config_build_from_source: true ) If we use that conditional logic enough, I think we can combine all three OSes most of the time. It would be good to streamline the CI by removing these env vars if not needed. We should track down the initial justification for including them ( |
I'm personally not sure this is more readable. It's inconvenient to open multiple files and remember how they are referenced across several files. |
The code for three operating systems is different enough (the scripts, paths, file names, etc). If we want to combine these, we should use the same shell (Bash or PowerShell), and find a way to parameterize the paths, and file names. |
4b282c9
to
878531b
Compare
This all seems good in the abstract... I am working on seeing why our CI doesn't tend to pass and I am finding all this diff that we already have from upstream hard to debug. Shouldn't we pause on this sort of stuff until we can get CI reliably passing? And thank you for working on it, regardless. |
This and #31 solve our CI problems. |
use Azure syntax for passing variables between the steps
bcf8686
to
ef45a89
Compare
This is ready to go 🚀 |
Thanks for all the work. I'll be taking a closer look some time at it so I understand what's changed. Apologies for all the grumbling about this. I may have gone overboard with that. A request: I'd love it if we could squash this into fewer commits, with clearly separated changes per commit, and containing (to the extent possible) just the final version of this PR's changes. This would help ensure we don't get confused when trying to rebase on Something like this:
(Maybe split up "using templates in platform definitions" (Windows, macOS, Linux) from "using templates in pipeline definitions" (nightly, pull requests,release branches... But I'm not sure there would be a benefit.) As mentioned above, this would be MUCH EASIER to rebase in the event of a merge conflict. Thank you for even considering!!! I volunteer to do it if you want! And if you'd rather not, I respect your decision. Just thought I'd say this sooner rather than later, so it's the easiest possible time to try and implement the squash/rewrite. |
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.
Some comments I have.
Impressed with the work this took. Happy to try it in our process and see if it works as well as it looks (it looks great!) Yes, it's different from before. But I've read it all now and I can understand it.
It is much easier to tell platform differences apart for repeated code now, because platform differences for repeated code lives within the same template. That's actually a big plus for readability.
Having to look at multiple files is lessened in its impact by the fact that these template files are supposed to "just work" and not need to be edited constantly, for one thing; And by the fact the the platform (Linux/macOS/Windows) yaml files are now much more skimmable. They can be read and comprehended more quickly.
I hope you don't mind my thoughts on this after it's already been merged. This is a post-merge review.
Thank you for looking and considering.
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 feels like it could be good to have GetReleaseVersion
in a template, too.
It's mostly identical everywhere it's used.
If you want I can try to do this.
I decided to not rebase our master anymore. See my comment here #28 (comment). It is harmful to our repository. |
We can do that. We run the following two times in each script.
So if you can make a template that includes both the following steps and have a condition to not run the
You should use my Please make your pull request to this branch, so I can upstream it as part of the PR. |
GITHUB_TOKEN: $(GITHUB_TOKEN) | ||
CI: true | ||
CI_PROVIDER: VSTS | ||
condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) |
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 indentation makes condition
and env variable. Bootstrapping always runs.
We should indent it two spaces less, toward the left.
(We should change this on master
now, I guess.)
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.
Thanks for catching this. I will fix it!
I can post updates to this branch and then open another PR from this (Then everything is in one place on this branch when you go to make a PR to upstream.) Edit: We'll figure something out. |
I will use git cherry pick to bring your commits to master. |
Description of the change
This uses Powershell 7 as a cross-platform shell for CI scripts:
This refactors CI scripts into separate files (templates):
It also allows using parallelization of the tests without copy-pasting the same code. For example:
This makes it easier to manage CI code. For example, we can quickly compare the publish step for all operating systems without going through big files and trying to find the relevant steps.
Previously, CI scripts were written back in ~2017. At that time, Azure Templates had not been introduced yet, and because of that using PowerShell was not suitable yet. Now in 2020, we can benefit from these and improve the CI.
Verification
The CI passes
Release Notes
N/A