-
Notifications
You must be signed in to change notification settings - Fork 1k
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
MSCI Various Fixes #1189
Closed
Closed
MSCI Various Fixes #1189
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d6cad29
Set up CI with Azure Pipelines
zparnold bb4e777
Merged PR 3956: Set up CI with Azure Pipelines
zparnold 0669290
Merged PR 3954: initial attempt to fix pr merge problems
zparnold e1fe904
Merged PR 3958: Go Vendoring
zparnold 69dc573
Merged PR 3960: Update azure-pipelines.yml for Azure Pipelines
zparnold 4dd211e
Merged PR 3964: add initial attempt to remove source config be config…
zparnold bdf4dd4
initial tested fix
b2d474e
Merged PR 3998: Fix for Branch policy status is not getting updated
d1a258a
Merge branch 'master' of github.com:runatlantis/atlantis
zparnold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Starter pipeline | ||
# Start with a minimal pipeline that you can customize to build and deploy your code. | ||
# Add steps that build, run tests, deploy, and more: | ||
# https://aka.ms/yaml | ||
|
||
trigger: | ||
- master | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
steps: | ||
- task: GoTool@0 | ||
inputs: | ||
version: '1.14' | ||
- task: Bash@3 | ||
inputs: | ||
targetType: 'inline' | ||
script: 'go mod vendor && make build-service' | ||
env: | ||
GOFLAGS: "-mod=vendor" | ||
- task: Docker@2 | ||
inputs: | ||
containerRegistry: 'atlantis-creg' | ||
repository: 'upstreamatlantis' | ||
command: 'buildAndPush' | ||
Dockerfile: './Dockerfile' | ||
tags: | | ||
$(Build.BuildId) | ||
latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,8 @@ const ( | |
DefaultParallelApplyEnabled = false | ||
// DefaultParallelPlanEnabled is the default for the parallel plan setting. | ||
DefaultParallelPlanEnabled = false | ||
// DefaultDeleteSourceBranchOnMerge being false is the default setting whether or not to remove a source branch on merge | ||
DefaultDeleteSourceBranchOnMerge = false | ||
) | ||
|
||
//go:generate pegomock generate -m --use-experimental-model-gen --package mocks -o mocks/mock_project_command_builder.go ProjectCommandBuilder | ||
|
@@ -174,7 +176,7 @@ func (p *DefaultProjectCommandBuilder) buildPlanAllCommands(ctx *CommandContext, | |
for _, mp := range matchingProjects { | ||
ctx.Log.Debug("determining config for project at dir: %q workspace: %q", mp.Dir, mp.Workspace) | ||
mergedCfg := p.GlobalCfg.MergeProjectCfg(ctx.Log, ctx.BaseRepo.ID(), mp, repoCfg) | ||
projCtxs = append(projCtxs, p.buildCtx(ctx, models.PlanCommand, mergedCfg, commentFlags, repoCfg.Automerge, repoCfg.ParallelApply, repoCfg.ParallelPlan, verbose, repoDir)) | ||
projCtxs = append(projCtxs, p.buildCtx(ctx, models.PlanCommand, mergedCfg, commentFlags, repoCfg.Automerge, repoCfg.ParallelApply, repoCfg.ParallelPlan, verbose, repoDir, repoCfg.DeleteSourceBranchOnMerge)) | ||
} | ||
} else { | ||
// If there is no config file, then we'll plan each project that | ||
|
@@ -185,7 +187,7 @@ func (p *DefaultProjectCommandBuilder) buildPlanAllCommands(ctx *CommandContext, | |
for _, mp := range modifiedProjects { | ||
ctx.Log.Debug("determining config for project at dir: %q", mp.Path) | ||
pCfg := p.GlobalCfg.DefaultProjCfg(ctx.Log, ctx.BaseRepo.ID(), mp.Path, DefaultWorkspace) | ||
projCtxs = append(projCtxs, p.buildCtx(ctx, models.PlanCommand, pCfg, commentFlags, DefaultAutomergeEnabled, DefaultParallelApplyEnabled, DefaultParallelPlanEnabled, verbose, repoDir)) | ||
projCtxs = append(projCtxs, p.buildCtx(ctx, models.PlanCommand, pCfg, commentFlags, DefaultAutomergeEnabled, DefaultParallelApplyEnabled, DefaultParallelPlanEnabled, verbose, repoDir, DefaultDeleteSourceBranchOnMerge)) | ||
} | ||
} | ||
|
||
|
@@ -320,12 +322,14 @@ func (p *DefaultProjectCommandBuilder) buildProjectCommandCtx( | |
automerge := DefaultAutomergeEnabled | ||
parallelApply := DefaultParallelApplyEnabled | ||
parallelPlan := DefaultParallelPlanEnabled | ||
deleteBranchOnMerge := DefaultDeleteSourceBranchOnMerge | ||
if repoCfgPtr != nil { | ||
automerge = repoCfgPtr.Automerge | ||
parallelApply = repoCfgPtr.ParallelApply | ||
parallelPlan = repoCfgPtr.ParallelPlan | ||
deleteBranchOnMerge = repoCfgPtr.DeleteSourceBranchOnMerge | ||
} | ||
return p.buildCtx(ctx, cmd, projCfg, commentFlags, automerge, parallelApply, parallelPlan, verbose, repoDir), nil | ||
return p.buildCtx(ctx, cmd, projCfg, commentFlags, automerge, parallelApply, parallelPlan, verbose, repoDir, deleteBranchOnMerge), nil | ||
} | ||
|
||
// getCfg returns the atlantis.yaml config (if it exists) for this project. If | ||
|
@@ -409,15 +413,7 @@ func (p *DefaultProjectCommandBuilder) validateWorkspaceAllowed(repoCfg *valid.R | |
} | ||
|
||
// buildCtx is a helper method that handles constructing the ProjectCommandContext. | ||
func (p *DefaultProjectCommandBuilder) buildCtx(ctx *CommandContext, | ||
cmd models.CommandName, | ||
projCfg valid.MergedProjectCfg, | ||
commentArgs []string, | ||
automergeEnabled bool, | ||
parallelApplyEnabled bool, | ||
parallelPlanEnabled bool, | ||
verbose bool, | ||
absRepoDir string) models.ProjectCommandContext { | ||
func (p *DefaultProjectCommandBuilder) buildCtx(ctx *CommandContext, cmd models.CommandName, projCfg valid.MergedProjectCfg, commentArgs []string, automergeEnabled bool, parallelApplyEnabled bool, parallelPlanEnabled bool, verbose bool, absRepoDir string, deleteBranchOnMerge bool) models.ProjectCommandContext { | ||
|
||
var steps []valid.Step | ||
switch cmd { | ||
|
@@ -438,6 +434,7 @@ func (p *DefaultProjectCommandBuilder) buildCtx(ctx *CommandContext, | |
BaseRepo: ctx.BaseRepo, | ||
EscapedCommentArgs: p.escapeArgs(commentArgs), | ||
AutomergeEnabled: automergeEnabled, | ||
DeleteSourceBranchOnMerge: deleteBranchOnMerge, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs fmt |
||
ParallelApplyEnabled: parallelApplyEnabled, | ||
ParallelPlanEnabled: parallelPlanEnabled, | ||
AutoplanEnabled: projCfg.AutoplanEnabled, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will change the form of the src argument from
atlantis/<command>
to just the command name. This src field is used by most of the VCS plugins to drive a data field that is sent along in the PR status update requests. Changing the format of this field is going to be a breaking change to anyone with a PR policy keyed off of this particular string.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been fighting #1172 as well and it's gotten to a point where we've had to disable the status policies altogether and rely on reviewers only. I'd like to 2nd what @acastle said, if I can help in any way to getting this merged let me know.
Would it make sense to use a different string just for DevOps users? It's already broken for them anyway and prevents breaking changes to other VCS users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jack64 I have submitted a separate PR #1209 that resolves just the status checks which was merged last week. There hasn't been a new release cut yet but if you do a new build off of master you should be all set.