This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(turbo): add
sticky-turbo plan
support (#190)
<!-- Thanks for sending a pull request! --> #### What this PR does / why we need it: Introduce new `sticky-turbo plan task` to allow planning of tasks before running them. Built to parallelize CI pipelines for faster PR review intervals. 1. **Test [plan]**: `pnpm sticky-turbo plan test` >> packages.json 2. **Test [$p]**: `for p packages.json` 1. `pnpm turbo run test --filter=p --concurency=2` 3. **Test [completed]**: for "Branch Protection: Require status checks to pass before merging"
- Loading branch information
Showing
12 changed files
with
173 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: OSS Governance | ||
name: OSS | ||
|
||
on: | ||
pull_request_target: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: OSS Governance | ||
name: OSS | ||
|
||
on: | ||
push: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#! /usr/bin/env node | ||
/* eslint-disable */ | ||
require('./dist/cli.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Command, Option } from 'clipanion'; | ||
import * as process from 'process'; | ||
|
||
import { Turbo } from './Turbo'; | ||
|
||
/** | ||
* Running `sticky-turbo plan test` generate a list of packages that contains a `test` script in the package. | ||
* You can use the output and loop through an array to run test individually via `turbo run test --filter=package` | ||
*/ | ||
export class TurboPlanCommand extends Command { | ||
static override paths = [[`plan`]]; | ||
|
||
task = Option.String({ required: true }); | ||
|
||
scope = Option.Boolean('--scope', true, { | ||
description: 'Include scope in the package name, default to true', | ||
}); | ||
|
||
async execute(): Promise<void> { | ||
const turbo = new Turbo(process.cwd()); | ||
const packages = turbo.planPackages(this.task).map((name) => { | ||
if (this.scope) { | ||
return name; | ||
} | ||
return name.replace(/^@[^/]+\//, ''); | ||
}); | ||
this.context.stdout.write(`${JSON.stringify(packages, null, 2)}`); | ||
this.context.stdout.write('\n'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { runExit } from 'clipanion'; | ||
|
||
import { TurboPlanCommand } from './TurboPlanCommand'; | ||
|
||
// noinspection JSIgnoredPromiseFromCall | ||
void runExit([TurboPlanCommand]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": ["//"], | ||
"pipeline": {} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.