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

Support Disabling Source Type Override Parameters #64

Closed
wants to merge 5 commits into from

Conversation

khola
Copy link
Contributor

@khola khola commented Apr 9, 2021

Issue #, if available:
#57

Description of changes:
Added additional input to allow for disabling the parameters sourceTypeOverride and sourceLocationOverride. Test cases added.

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

Check any applicable:

  • [] Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

@pavlovecjakePFG
Copy link

Thank you for working on this and submitting this pull request. We want this so we can use s3 as a source instead of GitHub. However, when testing your changes, s3 as a source fails with the following error:
"Source version should be empty for S3 folder source location".
The sourceVersion also needs to be left unset in order to get s3 to work as a source.

@@ -13,6 +13,9 @@ inputs:
env-vars-for-codebuild:
description: 'Comma separated list of environment variables to send to CodeBuild'
required: false
disable-source-override:
description: 'Set to `true` if you want do disable source repo override'

Choose a reason for hiding this comment

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

"if you want to" - typo

cbuto added a commit to Contrast-Security-OSS/aws-codebuild-run-build that referenced this pull request Jul 2, 2021
@mostmentor
Copy link

May I ask why this is not merged ? I need this feature very much in my project

@smailc
Copy link

smailc commented May 26, 2022

Is it going to be merged? I just want GitHub actions to trigger CodeBuild to run build commands in VPC. It doesn't need a source of GITHUB

@mostmentor
Copy link

@smailc I actually forked and tweaked it to do this https://github.com/mostmentor/aws-codebuild-run-build

Copy link
Contributor

@taoyong-ty taoyong-ty left a comment

Choose a reason for hiding this comment

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

@khola - Thank you so much for making this change.

Apology for the delayed review. If you are still interested in wrapping up and merging this pull request, please address the comment and resolve the conflicts.

I am ready to approve and release once the comments have been addressed

@@ -110,6 +110,8 @@ async function waitForBuildEndTime(sdk, { id, logs }, nextToken) {

function githubInputs() {
const projectName = core.getInput("project-name", { required: true });
const disableSourceOverride =
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - For consistency, could you either update this new line to use core.getInput("disable-source-override", {required: false}) === "true", or remove all other { required: false }s from githubInputs()?

@@ -94,6 +94,21 @@ describe("githubInputs", () => {
.and.to.deep.equal(["one", "two", "three", "four"]);
});

it("skips override when parameter is set to true", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. could you also add a assertion in build basic parameters for codeBuild.startBuild that expect(test).to.haveOwnProperty("disableSourceOverride").and.to.equal(false);

  2. the test case name is a bit confusing. should we just called it "can process disable-source-override"

repo: "repo",
disableSourceOverride: true,
});
expect(test).to.not.haveOwnProperty("sourceTypeOverride");
Copy link
Contributor

Choose a reason for hiding this comment

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

expect(test).to.not.haveOwnProperty("sourceLocationOverride");

@taoyong-ty
Copy link
Contributor

close this in favor of #102

@taoyong-ty taoyong-ty closed this Jan 31, 2023
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.

None yet

7 participants