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

Codecommit deprecation #7

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

durdina
Copy link

@durdina durdina commented Jan 17, 2025

Issue , if available: #6

Description of changes: Replacing dependency on AWS CodeCommit with GitHub for fetching source code in the source stage of CI/CD pipeline produced by this project.

There are some additional improvements organized as separate commits. Their respective documentation is in their commit messages. I am happy to split this PR into multiple PRs if would make the review easier.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

tag invalid: The image tag 'latest' already exists in the 'helloworld' repository and cannot be overwritten because the repository is immutable.
  ERROR: unable to select packages:
  libcrypto3-3.3.2-r1:
    breaks: world[libcrypto3=3.0.8-r0]
    satisfies: libssl3-3.3.2-r1[libcrypto3=3.3.2-r1]
               libssl3-3.3.2-r1[so:libcrypto.so.3]
               wget-1.24.5-r0[so:libcrypto.so.3]
               apk-tools-2.14.4-r1[so:libcrypto.so.3]
  libssl3-3.3.2-r1:
    breaks: world[libssl3=3.0.8-r0]
    satisfies: wget-1.24.5-r0[so:libssl.so.3]
               apk-tools-2.14.4-r1[so:libssl.so.3]
@@ -10,7 +10,6 @@ phases:
- apt-get install -y wget apt-transport-https gnupg lsb-release curl
- curl -OL https://github.com/aws/aws-codeguru-cli/releases/download/0.2.3/aws-codeguru-cli.zip
- unzip aws-codeguru-cli.zip
- export PATH=$PATH:./aws-codeguru-cli/bin
Copy link
Author

Choose a reason for hiding this comment

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

Not needed as command is executed with full path $BASE/aws-codeguru-cli/bin/aws-codeguru-cli

@@ -341,6 +341,8 @@ Resources:
- s3:GetObject
- s3:GetObjectVersion
- s3:GetBucketVersioning
- s3:DeleteObject
Copy link
Author

@durdina durdina Jan 17, 2025

Choose a reason for hiding this comment

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

There were warnings in build.log if these permissions were missing:

Started new CodeGuru Reviewer scan: https://console.aws.amazon.com/codeguru/reviewer?region=us-east-1#/codereviews/details/arn:aws:codeguru-reviewer:us-east-1:840195444908:association:a36fcc80-a61e-44e3-b340-8f8966a79d12:code-review:PullRequest-codeguru-reviewer-cli-9b840f09-21ce-461d-832e-0e61ea2ae8cd
................................................................................:)
Failed to delete analysis-src-fb1f9859-d7c8-41c2-9993-4f194ee256b2.zip from codeguru-reviewer-cli-840195444908-us-east-1. Please delete the object by hand.
Failed to delete analysis-bin-ab374d09-b686-4a1b-b746-43d9460a3cbc.zip from codeguru-reviewer-cli-840195444908-us-east-1. Please delete the object by hand.

@@ -618,8 +608,6 @@ Resources:
Artifacts:
Type: CODEPIPELINE
Source:
Location:
Copy link
Author

Choose a reason for hiding this comment

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

Location is ignored in conjunction with Type: CODEPIPELINE.

DockerRepo:
Type: AWS::ECR::Repository
Properties:
ImageTagMutability: IMMUTABLE
ImageTagMutability: MUTABLE
Copy link
Author

Choose a reason for hiding this comment

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

With ImageTagMutability: IMMUTABLE repeated runs of code pipeline failed with the following error

tag invalid: The image tag 'latest' already exists in the 'helloworld' repository and cannot be overwritten because the repository is immutable.

RUN mkdir -p /opt/target
RUN apk update && apk add wget && wget $CODEGURU_PROFILER_AGENT_DOWNLOAD_URL -O /opt/target/codeguru-profiler-java-agent-standalone.jar
RUN apk add libcrypto3=3.0.8-r0 libssl3=3.0.8-r0
RUN apk add --upgrade libcrypto3 libssl3
Copy link
Author

Choose a reason for hiding this comment

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

This caused an error:

Step 9/16 : RUN apk add libcrypto3=3.0.8-r0 libssl3=3.0.8-r0
 ---> Running in 43106c860328
ERROR: unable to select packages:
  libcrypto3-3.3.2-r1:
    breaks: world[libcrypto3=3.0.8-r0]
    satisfies: libssl3-3.3.2-r1[libcrypto3=3.3.2-r1]
               libssl3-3.3.2-r1[so:libcrypto.so.3]
               wget-1.24.5-r0[so:libcrypto.so.3]
               apk-tools-2.14.4-r1[so:libcrypto.so.3]
  libssl3-3.3.2-r1:
    breaks: world[libssl3=3.0.8-r0]
    satisfies: wget-1.24.5-r0[so:libssl.so.3]
               apk-tools-2.14.4-r1[so:libssl.so.3]
The command '/bin/sh -c apk add libcrypto3=3.0.8-r0 libssl3=3.0.8-r0' returned a non-zero code: 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant