Skip to content
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

Initial repo layout #6

Merged
merged 3 commits into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@
# Shared Travis Configuration Imports

This repository is managed by the
[package-maintenance team](https://github.com/nodejs/package-maintenance).
- This repository is managed by the [package-maintenance team](https://github.com/nodejs/package-maintenance).
- Read more about [Shared Build Configurations in Travis CI](https://docs.travis-ci.com/user/build-config-imports/).

## Usage

Replace the list of `node_js` versions in your `.travis.yml` with one of the available files.

### Examples

#### `lts` policy: use LTS and current Node.js releases, starting with v10.x

```
import:
- nodejs/ci-config-travis:lts/gte-10.yml
```

- Travis CI will use the latest version of each release line in the list
- New major Node.js versions, greater or equal to v10.0.0, will be added to the list as soon as they are released
- Once added, LTS versions will never be removed. Non-LTS versions will be removed when they reach their lifetime.
- Note that if your policy is to only support LTS versions, then removing the non-LTS version in your test matrix is not a breaking change, as the non-LTS version was never supported (it was only used for test purposes).


#### `all` policy: use all Node.js releases, starting with v14.x

```
import:
- nodejs/ci-config-travis:all/gte-14.yml
```

- Travis will use the latest version of each release line in the list
- New major Node.js versions, greater or equal to v14.0.0, will be added to the list as soon as they are released
- Once added, versions will never be removed from the list


#### Strict `lts` policy: use only LTS Node.js releases, starting with v10.x

```
import:
- nodejs/ci-config-travis:lts/strict/gte-10.yml
```

- Travis will use the latest version of each release line in the list
- New major Node.js versions, greater or equal to v14.0.0, will be added to the list as soon as they achieve LTS status (i.e. ~6 months after they are released)
- Once added, versions will never be removed from the list
6 changes: 6 additions & 0 deletions all/gte-10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_js:
- 10
- 11
- 12
- 13
- 14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could import gte-11, etc, so they're all composed together - is there a reason you didn't go that route?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That did not occur to me, TBH - I kept it simple and explicit.

I figure explicit is better than indirect for someone looking at the file as well - no need to go click through and trace things?

Doubt performance is major issue, but fewer imports should be faster too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt it affects performance much; i have a chain of imports to build up almost 300 jobs on all 250+ of my projects and it works fine :-)

as for explicit/implicit, that's a fair point - i'm more thinking of the likelihood of an error in one file being noticed, versus in the chain of imports it'd be very noticeable.

Copy link
Member Author

@dominykas dominykas Jul 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fair point on error tracking, but that's probably more of an issue when the files are a little more complex than what we have here?

Having errors in these files would have a pretty bad knock on effect, if the ecosystem adopts this, but we can mitigate against that:

  1. I do have a generator script; it's pretty trivial, so I didn't bother putting it anywhere else than a branch on my fork. I don't know where to put it just yet, but unit tests on it would be the first life of defense. Alternatively, I'm pondering if I can force renovate to update these files and avoid having to think about where to place the script. Time enough till October to figure this out 😂
  2. There should be an "integration" test as well. One idea I have is to add a .travis.yml in here, which just imports all the available files via local import (node --version or smth as a test script itself). It shouldn't matter if Travis deduplicates or duplicates the final list (it has the various merge strategies, but I don't recall anything about deduplication) - doing this would at least guarantee the file validation - I think the job just freezes if it doesn't validate? Might need to work around You can import up to 25 build configuration snippets in total..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been asking travis for item 2 there for a long time :-/ some kind of travis reify command would be amazing (we could build it, it's just better to use the canonical implementation). Certainly a viable (but complex) approach would be generating a build on a throwaway branch, downloading the derived config from it, and then cancelling the build (all theroetically doable via travis' API).

You're also totally right about the 25 import limit, which I've told them repeatedly is way too low, so maybe your item 1 is a more reliable approach.

(To be clear, I'm content to consider this a followon and not a blocker)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some kind of travis reify command would be amazing (we could build it, it's just better to use the canonical implementation)

I did build some of that into detect-node-support. It's not canonical, but I think it's close enough (checked against https://github.com/travis-ci/travis-yaml) and the only missing feature, I think, is the if support (cause I didn't need it). There is code in there for the merge strategies, but I didn't check how does fetch things, esp. from private repos 🤔 I wonder if it's possibly to write a CLI wrapper or smth around their travis-yaml thing 🤔

5 changes: 5 additions & 0 deletions all/gte-11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_js:
- 11
- 12
- 13
- 14
4 changes: 4 additions & 0 deletions all/gte-12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_js:
- 12
- 13
- 14
3 changes: 3 additions & 0 deletions all/gte-13.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_js:
- 13
- 14
2 changes: 2 additions & 0 deletions all/gte-14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_js:
- 14
12 changes: 12 additions & 0 deletions all/gte-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_js:
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
11 changes: 11 additions & 0 deletions all/gte-5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_js:
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
10 changes: 10 additions & 0 deletions all/gte-6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_js:
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
9 changes: 9 additions & 0 deletions all/gte-7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_js:
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
8 changes: 8 additions & 0 deletions all/gte-8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_js:
- 8
- 9
- 10
- 11
- 12
- 13
- 14
7 changes: 7 additions & 0 deletions all/gte-9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_js:
- 9
- 10
- 11
- 12
- 13
- 14
4 changes: 4 additions & 0 deletions lts/gte-10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_js:
- 10
- 12
- 14
3 changes: 3 additions & 0 deletions lts/gte-12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_js:
- 12
- 14
2 changes: 2 additions & 0 deletions lts/gte-14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_js:
- 14
7 changes: 7 additions & 0 deletions lts/gte-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_js:
- 4
- 6
- 8
- 10
- 12
- 14
6 changes: 6 additions & 0 deletions lts/gte-6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_js:
- 6
- 8
- 10
- 12
- 14
5 changes: 5 additions & 0 deletions lts/gte-8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_js:
- 8
- 10
- 12
- 14
3 changes: 3 additions & 0 deletions lts/strict/gte-10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_js:
- 10
- 12
2 changes: 2 additions & 0 deletions lts/strict/gte-12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_js:
- 12
6 changes: 6 additions & 0 deletions lts/strict/gte-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_js:
- 4
- 6
- 8
- 10
- 12
5 changes: 5 additions & 0 deletions lts/strict/gte-6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_js:
- 6
- 8
- 10
- 12
4 changes: 4 additions & 0 deletions lts/strict/gte-8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_js:
- 8
- 10
- 12