Feature request: `fileAssetJobSettings` for file-asset publishing jobs

Open
#1,466 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
github-actions, typescript
Domain
ci-cd

Research direction

Start in src/pipeline.ts at jobForAssetPublish(), especially the hardcoded cdk-assets install step, and compare it with the existing dockerAssetJobSettings handling. Trace GitHubWorkflowProps and the asset publishing job generation to identify the relevant public interfaces. Done means file-asset jobs accept setup steps and additional permissions, with generated workflows reflecting those settings.

Written by the indexing model from the issue text.

Description

GitHubWorkflowProps exposes dockerAssetJobSettings to inject setupSteps and extra permissions into Docker-asset publishing jobs, but there is no equivalent for file-asset publishing jobs (Assets-FileAsset*).

The npm install --no-save cdk-assets step in jobForAssetPublish() is hardcoded, so there is no way to configure the npm registry, inject credentials, or add any pre-install step through the public API.

Proposed API
export interface FileAssetJobSettings {
  /** Steps to execute before installing cdk-assets and publishing. @default [] */
  readonly setupSteps?: github.JobStep[];
  /** Additional permissions for file-asset publishing jobs. @default - none */
  readonly permissions?: github.JobPermissions;
}

export interface GitHubWorkflowProps extends PipelineBaseProps {
  /** Job level settings applied to all file asset publishing jobs. @default - none */
  readonly fileAssetJobSettings?: FileAssetJobSettings;
}

setupSteps would be injected immediately before the Install step in jobForAssetPublish(), consistent with how dockerAssetJobSettings.setupSteps is handled for Docker asset jobs.

Use case

Any organisation that needs to configure npm before install - private registry, npm proxy, authentication - currently has no way to do so for file-asset jobs.

Would you be willing to submit a PR?

Yes.

Dominant language
TypeScript
Stars
384
Forks
47
Avg merge
1d 7h
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cdklabs/cdk-pipelines-github

All issues in cdklabs/cdk-pipelines-github

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.