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

Add pull request option support #59

Merged
merged 6 commits into from
Apr 12, 2022
Merged

Add pull request option support #59

merged 6 commits into from
Apr 12, 2022

Conversation

chalenge
Copy link
Contributor

Closes #

About

Add ability to pass the pull request number associated with CI/CD event commit

Screenshots

Extras

@chalenge chalenge requested review from willmarks and tovbinm and removed request for willmarks April 12, 2022 19:18
faros_event.sh Outdated Show resolved Hide resolved
faros_event.sh Outdated Show resolved Hide resolved
test/demo.sh Show resolved Hide resolved
Signed-off-by: Chalenge Masekera <chalenge@faros.ai>
faros_event.sh Outdated
@@ -107,20 +108,22 @@ function help() {
echo "--deploy_status | Yes | $deploy_statuses"
echo "--artifact | *2 | $artifact_uri_form"
echo "--commit | *2 | $commit_uri_form"
echo "--pull_request_number | | *3 | e.g. 123 (should be a number)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we want *3 to be in Req column

Copy link
Contributor Author

@chalenge chalenge Apr 12, 2022

Choose a reason for hiding this comment

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

It is never required, so maybe --pull_request_number | | *3 e.g. 123 (should be a number)"

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 @willmarks it's conditionally required, that's whye there is the *

README.md Outdated
@@ -101,6 +101,7 @@ A `CI` event communicates the outcome of a code build pipeline execution, and it
| Argument | Description | Required | Allowed Value |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | ----------------------------------------------------------- |
| &#x2011;&#x2011;commit | The URI of the commit. (`<source>://<organization>/<repository>/<commit_sha>` e.g. `GitHub://faros-ai/my-repo/da500aa4f54cbf8f3eb47a1dc2c136715c9197b9`) | Yes | |
| &#x2011;&#x2011;pull_request_number | The pull request number of the commit. (`e.g. 1`) | | |
Copy link
Contributor

Choose a reason for hiding this comment

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

e.g. 123

README.md Outdated
@@ -123,6 +124,7 @@ A `CD` event communicates the outcome of an application deployment pipeline exec
| &#x2011;&#x2011;deploy_status | The status of the deployment. | Yes | Success, Failed, Canceled, Queued, Running, RolledBack, Custom |
| &#x2011;&#x2011;artifact | The URI of the artifact. (`<source>://<organization>/<repository>/<artifact_id>` e.g. `DockerHub://farosai/my-repo/da500aa4f54cbf8f3eb47a1dc2c136715c9197b9`) | Either &#x2011;&#x2011;commit or &#x2011;&#x2011;artifact | |
| &#x2011;&#x2011;commit | The URI of the commit. (`<source>://<organization>/<repository>/<commit_sha>` e.g. `GitHub://faros-ai/my-repo/da500aa4f54cbf8f3eb47a1dc2c136715c9197b9`) | Either &#x2011;&#x2011;commit or &#x2011;&#x2011;artifact | |
| &#x2011;&#x2011;pull_request_number | The pull request number of the commit. (`e.g. 1`). Used only if --commit is included | | |
Copy link
Contributor

Choose a reason for hiding this comment

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

e.g. 123 as well

../faros_event.sh CI -k "<api_key>" \
--artifact "<artifact_source>://<artifact_org>/<artifact_repo>/<artifact>" \
--commit "<vcs_source>://<vcs_organization>/<vcs_repo>/<commit_sha>" \
--pull_request_number "101" \
Copy link
Contributor

Choose a reason for hiding this comment

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

can we allow --pull_request_number 101 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is allowed. Updated the README and added test

@chalenge chalenge merged commit ddc775f into main Apr 12, 2022
@chalenge chalenge deleted the chale/pull-request-commit branch April 12, 2022 21:00
@tovbinm
Copy link
Contributor

tovbinm commented Apr 12, 2022

nice!

bump the version + release

@chalenge
Copy link
Contributor Author

nice!

bump the version + release

@willmarks promised to take care of that 🙏🏽

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

3 participants