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(deploy): add Source Control Management context to api request #183

Merged
merged 19 commits into from
Sep 6, 2023

Conversation

cs-simental
Copy link
Contributor

@cs-simental cs-simental commented Aug 24, 2023

CDAAS-2741

Move the logic for generating the information from the github action to the armory-cli

This change adds a Sim property to the request made to the deploy engine API so that work in Deploy engine will later saved and this information will be available for the PR lineage in the UI.

This was tested by running the armory client pointing to the remote-dev armory address using the new flag --with-scm. Using the goland debugging tools I was able to validate that the scmc data is being add to the request and the pipeline is triggered and deployed without issues

Started the github context retrieval
Source Control Management Context added to the deployment request under sourceControl
Changed the ScmContext and made and embedded struct githubScmc
cmd/deploy/start.go Outdated Show resolved Hide resolved
fieldju

This comment was marked as resolved.

@fieldju fieldju dismissed their stale review August 25, 2023 15:54

I miss read somethings, sanity checking now

Taking into account the Env variables already being there when the test are run in github
@mrampton mrampton changed the title feat(deploy): Added Source Control Management context to the api request feat(deploy): add Source Control Management context to api request Aug 25, 2023
@cs-simental cs-simental requested a review from fieldju August 25, 2023 18:53
Copy link
Contributor

@fieldju fieldju left a comment

Choose a reason for hiding this comment

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

When you merge this it gets auto-published as a dev release which some (not all though) of our projects use.

So once the actions are complete you can UAT this before promoting the dev release to a proper full release that is consumed by customers

added missing property 'sourcecontrol: null'
Validate that env variables are not empty
Validate that pr pointer is not empty when a bad token is given
cmd/deploy/start.go Outdated Show resolved Hide resolved
cmd/deploy/start.go Outdated Show resolved Hide resolved
cmd/sourceControl/scm.go Outdated Show resolved Hide resolved
pkg/deploy/request.go Outdated Show resolved Hide resolved
cmd/sourceControl/scm.go Outdated Show resolved Hide resolved
Comment on lines 15 to 28
const (
ghToken = "GH_TOKEN"
ghRepo = "GITHUB_REPOSITORY"
ghRefName = "GITHUB_REF_NAME"
ghActor = "GITHUB_ACTOR"
ghSha = "GITHUB_SHA"
ghEvent = "GITHUB_EVENT_NAME"
ghRef = "GITHUB_REF"
ghTriggeringActor = "GITHUB_TRIGGERING_ACTOR"
ghRefType = "GITHUB_REF_TYPE"
ghServer = "GITHUB_SERVER_URL"
ghRunId = "GITHUB_RUN_ID"
ghWorkflow = "GITHUB_WORKFLOW"
)
Copy link

Choose a reason for hiding this comment

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

These should all be available in deploy-engine:api -- but the names start as Github (so GithubToken, etc).

Comment on lines 25 to 33
const (
github de.Manager = "github"
bitbucket de.Manager = "bitbucket"
branch de.Reference = "branch"
tagRef de.Reference = "tag"
pullRequest de.Event = "pull_request"
push de.Event = "push"
workflowDispatch de.Event = "workflow_dispatch"
)
Copy link

Choose a reason for hiding this comment

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

These are likewise available in deploy-engine :)

@armory-cloud-sonarqube
Copy link

@cs-simental cs-simental merged commit b67c80a into main Sep 6, 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.

3 participants