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

feat: Implement CodeArtifact L2 construct #11091

Closed
wants to merge 35 commits into from

Conversation

jstandish
Copy link


#11090
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Oct 25, 2020

Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Tackling an L2 is always a fun challenge. Here's my first pass of comments.


Please add @experimental to the docstrings all of the exported interfaces/classes.


General comment on styling/formatting. This package is currently missing the .eslintrc.js file which would bring up a lot of formatting/spacing/styling changes. Can you please add (just copy/paste from another module) and clean up?

@mergify mergify bot dismissed njlynch’s stale review October 27, 2020 18:10

Pull request has been modified.

@jstandish
Copy link
Author

Ready for 2nd review

njlynch
njlynch previously requested changes Nov 2, 2020
Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

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

Made it to about halfway through Repository; a lot of the comments on Domain apply throughout.

Remember to add the missing .eslintrc.js file; there are a lot of formatting/style issues that it will catch that I'm not bothering to comment on (yet).

```ts
import * as codeartifact from '@aws-cdk/aws-codeartifact';

const domain = new codeartifact.Domain(stack, 'domain', { domainName: 'example-domain' });
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const domain = new codeartifact.Domain(stack, 'domain', { domainName: 'example-domain' });
new codeartifact.Domain(stack, 'domain', { domainName: 'example-domain' });

const domain = new codeartifact.Domain(stack, 'domain', { domainName: 'example-domain' });
const repository = new codeartifact.Repository(stack, 'repository', {
repositoryName: 'repository',
domain: domain,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
domain: domain,
domain,

Comment on lines +45 to +49
const domain = new codeartifact.Domain(stack, 'domain', { domainName: 'example-domain' });
const repo1 = new codeartifact.Repository(stack, 'repository_1', { repositoryName: 'repository-1' });
const repo2 = new codeartifact.Repository(stack, 'repository_2', { repositoryName: 'repository-2' });

domain.addRepositories(repo1, repo2);
Copy link
Contributor

Choose a reason for hiding this comment

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

Take a look at https://github.com/aws/aws-cdk/blob/master/DESIGN_GUIDELINES.md#factories again. Ideally, this addRepository method takes in a RepositoryOption interface, which is a sub-interface of RepositoryProps.

export interface RepositoryOptions {
  readonly repositoryName: string,
  readonly description?: string,
  ...
}
export interface RepositoryProps extends RepositoryOptions {
  readonly domain: IDomain;
}
// THEN
const domain = new codeartifact.Domain(stack, 'Domain');
domain.addRespository({ repositoryName: 'MyRepo', description: 'NPM + Java repo' });

```

### External Connections
Extenal connections can be added by calling `.withExternalConnections(...)` method on a repository. It accepts and
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a sentence (or two) here (and for Upstream Repositories) just explaining what they are? Also, I still think we should defer withExternalConnections until we have a use case.

domainName: props.domain?.domainName || '',
repositoryName: props.repositoryName,
description: props.description,
upstreams: props.upstreams ? props.upstreams.map(u => u.repositoryName) : [] as string[],
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
upstreams: props.upstreams ? props.upstreams.map(u => u.repositoryName) : [] as string[],
upstreams: props.upstreams?.map(u => u.repositoryName),

}

if (rule.pattern && !rule.pattern.test(value)) {
throw new Error(`${name}: must match pattern ${rule.pattern.source}. Must match rules from ${rule.documentationLink}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding the documentationLink here I don't think adds a ton of value, since the pattern is already in the message.

@njlynch njlynch added the pr/requires-two-approvers This PR is critical (e.g., security, broadly-impacting) and requires 2 approvers to be merged. label Dec 2, 2020
@mergify mergify bot dismissed njlynch’s stale review December 19, 2020 21:02

Pull request has been modified.

Copy link
Author

@jstandish jstandish left a comment

Choose a reason for hiding this comment

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

Implemented review items.

@mergify
Copy link
Contributor

mergify bot commented Dec 29, 2020

Title does not follow the guidelines of Conventional Commits. Please adjust title before merge.

@jstandish jstandish changed the title Code artifact l2 feat: Implement CodeArtifact L2 construct Jan 4, 2021
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 070c4c6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@njlynch
Copy link
Contributor

njlynch commented Jan 4, 2021

Implemented review items.

Can you take another pass? I see that most of my comments from the last round of feedback have still not been addressed.

@njlynch njlynch added p2 effort/medium Medium work item – several days of effort labels Mar 18, 2021
@njlynch
Copy link
Contributor

njlynch commented Jun 7, 2021

Hi jstandish,

For tracking sake, I'm going to close this PR, as we haven't made any progress in a while. When you're ready to pick this back up, feel free to mention me to re-open this, or just create a new PR.

Thanks!

@njlynch njlynch closed this Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days of effort p2 pr/requires-two-approvers This PR is critical (e.g., security, broadly-impacting) and requires 2 approvers to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants