Hi! projen maintainer here! I saw your PR here to workaround some recent issues you had with projen. Firstly, sorry about that! The task shell change was a big one and unfortunately not without issues.
While I was investigating the issue, I found some minor things you could improve in your projen config. Just sharing in case you want to fix them. Hope this is useful to you. Feel free to close and ignore!
|
project.tasks.shell = TaskShell.system(); |
Not needed anymore, once this upstream PR is released projen/projen#4854
|
githubActions.set( |
|
"peter-evans/create-pull-request", |
|
"peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676", // v7 |
|
); |
|
githubActions.set( |
|
"actions/setup-node", |
|
"actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444", // v5 |
|
); |
Some actions now publish immutable releases. Might be easier for users to look at an immutable tag.
|
// Use a protected environment for the upgrade workflow to access the environment secrets |
|
project.github?.tryFindWorkflow("upgrade")?.file?.patch( |
|
JsonPatch.add("/jobs/pr/environment", { |
|
name: "protected-main-env", |
|
}), |
|
); |
Instead, add this to your credentials and the environment will automatically be filled whenever the credentials are used:
projenCredentials: github.GithubCredentials.fromApp({
appIdSecret: "GH_APP_ID",
privateKeySecret: "GH_APP_PRIVATE_KEY",
environment: "protected-main-env",
}),
|
project.github?.tryFindWorkflow("upgrade")?.file?.patch( |
|
JsonPatch.add("/jobs/upgrade/steps/1", { |
|
name: "Enable Corepack", |
|
run: "corepack enable", |
|
}), |
|
); |
Can be removed, since corepack is now automatically enabled by projen. Currently you enable it twice.
|
project.github?.tryFindWorkflow("upgrade")?.file?.patch( |
|
JsonPatch.add("/jobs/upgrade/steps/5/env", { |
|
YARN_ENABLE_IMMUTABLE_INSTALLS: "false", |
|
}), |
|
); |
Similar, this is now also handled by projen natively (but set in the task, not the workflow) and can be removed.
|
projenTasks.addDeletionOverride("tasks.clobber"); |
|
projenTasks.addDeletionOverride("tasks.test:update"); |
|
projenTasks.addDeletionOverride("tasks.release"); |
|
projenTasks.addDeletionOverride("tasks.bump"); |
|
projenTasks.addDeletionOverride("tasks.compat"); |
|
projenTasks.addDeletionOverride("tasks.test:compile"); |
|
const npmScripts = project.tryFindObjectFile("package.json")!; |
|
npmScripts.addDeletionOverride("scripts.clobber"); |
|
npmScripts.addDeletionOverride("scripts.test:update"); |
|
npmScripts.addDeletionOverride("scripts.release"); |
|
npmScripts.addDeletionOverride("scripts.bump"); |
|
npmScripts.addDeletionOverride("scripts.compat"); |
|
projenTasks.addDeletionOverride("scripts.test:compile"); |
Some of these are seemingly not working today, but the easiest way to completely remove a task everywhere is:
project.tasks.removeTask("clobber");
Hi! projen maintainer here! I saw your PR here to workaround some recent issues you had with projen. Firstly, sorry about that! The task shell change was a big one and unfortunately not without issues.
While I was investigating the issue, I found some minor things you could improve in your projen config. Just sharing in case you want to fix them. Hope this is useful to you. Feel free to close and ignore!
datadog-cdk-constructs/.projenrc.ts
Line 118 in 024979a
Not needed anymore, once this upstream PR is released projen/projen#4854
datadog-cdk-constructs/.projenrc.ts
Lines 138 to 141 in 024979a
datadog-cdk-constructs/.projenrc.ts
Lines 126 to 129 in 024979a
Some actions now publish immutable releases. Might be easier for users to look at an immutable tag.
datadog-cdk-constructs/.projenrc.ts
Lines 147 to 152 in 024979a
Instead, add this to your credentials and the environment will automatically be filled whenever the credentials are used:
datadog-cdk-constructs/.projenrc.ts
Lines 157 to 162 in 024979a
Can be removed, since
corepackis now automatically enabled by projen. Currently you enable it twice.datadog-cdk-constructs/.projenrc.ts
Lines 180 to 184 in 024979a
Similar, this is now also handled by projen natively (but set in the task, not the workflow) and can be removed.
datadog-cdk-constructs/.projenrc.ts
Lines 249 to 254 in 024979a
datadog-cdk-constructs/.projenrc.ts
Lines 266 to 272 in 024979a
Some of these are seemingly not working today, but the easiest way to completely remove a task everywhere is: