Commit Graph

41 Commits

Author SHA1 Message Date
Simon Heather
4bea4e934a chore: Add Struct required tags and Server Struct Validator (#5371)
Signed-off-by: X-Guardian <32168619+X-Guardian@users.noreply.github.com>
2025-03-09 11:34:48 +00:00
Rui Chen
8dccb2beb4 chore(lint): linting the codebase (#4668)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-06-17 11:22:30 -04:00
Joseph Mulloy
93578d86b3 fix: Use ISO 8601 date format (#4141)
Co-authored-by: Luke Massa <lmassa@tripadvisor.com>
2024-05-01 00:24:56 -04:00
Simon Heather
fb69965fd7 chore: Rename templates package to web_templates (#4383) 2024-03-27 12:05:52 -04:00
Marcos Diez
ce95f8ee05 feat: Jobs now shown in a table in the main page (#3784)
* feat: better logging for UpdateStatus

* feat: jobs now shown in a table in the main page

---------

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-12-11 21:34:33 -05:00
Ken Kaizu
3954955e13 fix(deps): update module github.com/petergtz/pegomock/v3 to v4 (#3534)
* fix(deps): update module github.com/petergtz/pegomock/v3 to v4 in go.mod

* remove pegomock generate m option, which is not support after v4

* make regen-mocks

* replace pegomock v4 primitive eq/matchers

* convert pegomock v4 Eq/Any matchers

* remove custom models.Repo matcher

* pegomock v4 cannot use result method args

ref https://github.com/petergtz/pegomock/issues/123

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-20 15:05:23 -04:00
nitrocode
e505817a7d chore(deps): bump pegomock v3.0.1 (#3515) 2023-06-13 11:36:09 -07:00
Ross Strickland
ad75aace78 fix: Initialize VCSClient for commandrunner to remove recent server panics (#3461)
* Initialize VCSClient for commandrunner.

* Add test.
2023-05-30 14:32:37 -04:00
Casey Miller
9b90f2e4f4 Adding reloading of TLS certificates (#2656)
* Adding reloading of TLS certificates

* Update server/server.go

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Adding test and test data

* Set minimum tls version

* Adding read header timeout

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-11-14 12:49:34 -06:00
Eng Zer Jun
49c5eba458 test: use T.TempDir to create temporary test directory (#2671)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-11-13 14:13:29 -06:00
Leandro López
ca28b577a4 chore: improve /healthz endpoint performance (#2014)
* Add benchmark for /healthz endpoint

This benchmark will measure not only speed but also how much memory
each request to /healthz allocate. I'm adding the benchmark to have a
baseline to compare.

Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>

* Hardcode /healthz body into a variable

We know it will always be this value, there's no need to import and
call json.MarshalIndent.

Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>

* Initialize /healthz body only once

Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>
2022-01-22 23:08:12 -05:00
Eng Zer Jun
38cf7b0141 refactor: move from io/ioutil to io and os package (#1843)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-10-07 00:37:42 -04:00
Nish Krishnan
d914eafd2a Move core workflow packages under core. (#1684)
* Move core workflow packages under core.

* lint.
2021-07-01 12:54:44 -07:00
Nish Krishnan
712498da58 Refactor controllers into package. (#1597) 2021-06-01 11:58:01 -07:00
Nish Krishnan
7ac8106f8a Add structured logger (#54) (#1467)
This is two changes:

Replacing all usages of SimpleLogger with it's interface SimpleLogging which makes it easier to swap out loggers going forward
Nukes SimpleLogger in favor of StructuredLogger which allows us to better analyze logs in our log management system we choose.
2021-04-06 12:02:25 -07:00
Sarvar Muminov
ad76385c76 Global atlantis lock new release branch (#1473)
* Orca 679 global atlantis lock new release branch (#49)

* Adding CommandLocker to boltDB and exposing it through locker interface

* Apply lock ui and apply command lock controller

* Minor comments

* Adding more tests and refactorinng

* Linting fixes

* creating applyLockingClient variable to fix interface error

* nullsink for stats

* Addressing PR comments

* fixing e2e tests

* linting fix fml

* Update outdated function descriptions

Address PR comments

* revert stats sink changes

* remove unnecessary dependencies
2021-04-01 15:40:29 -07:00
Sarvar Muminov
af2a806870 Implement a new policy check workflow (#1317)
* Adding policy_check support into yaml config

* Added policy check model and runtime structs

* Adding BuildPolicyCheckCommand to ProjectCommandBuilder

* Return incorrectly deleted code

* Remove BuildAutoPolicyPlanCommand from ProjectCommandBuilder

* Split runAutoCommand into two functions

runAutoPlanCommand - does what originally RunAutoplancommand was doing
except now it returns CommandResult and []models.ProjectCommandContext
runAutoPolicyCheckCommand - accepts CommandContext, CommandResult, and
[]models.ProjectCommandContext as arguments and runs PolicyCheckStep runner

* Refactor RunCommentCommand
* Remove BuildPolicyCheckCommand and rename StepCmdExec back to TerraformExec
* Add policy step runner logic and conftest interfaces.
* Add show step runner to policy check stage.

* Adding models.PolicyCheckCommand to buildCtx

This also means buildPlanAllCommands call buildCtx twice once with
models.PlanCommand and once with models.PolicyCheckCommand

* Adding new project_command_builder that supports policy_check

* Refactoring PolicyCheck specific logic into a PolicyCheckProjectCommandBuilder

* Moving events.CommandContext to models.CommandContext this will allow me
to remove buildCtx method and move ProjectCommandContext creation into
models package

* Policy Owners might be different types, for that reason we are
refactoring Owners into its own struct with specific keys defining
different owner types

Co-authored-by: Nish Krishnan <nishk@lyft.com>
Co-authored-by: Nish Krishnan <nishkrishnan@users.noreply.github.com>
2021-02-10 18:13:44 -08:00
CJ Ketchum
611ed55c8c Fix parse URL tests 2020-04-10 14:36:53 -07:00
Josh Soref
2cf5b0a42a Spelling (#902)
Spelling fixes
2020-01-20 12:46:00 -06:00
Dave D'Amico
83b2adb593 Issue 720: display workspace name in locks UI list (#763)
* final updates for PR

* more updates

* final changes - ready for re-review

* changes based on feedabck

* forgot to update test
2019-09-16 13:07:10 -04:00
Luke Kysow
d78b106cab Refactor @jjulien's server-side config work. 2019-03-27 14:47:48 -05:00
John Julien
1fcdaba719 Added new --repo-config option and deprecated --allow-repo-config
This enables atlantis.yaml in all repos, but by default restricts
certain sensitive keys from being used.

The keys apply_requirements, workflow, and workflows can only be
specified in an atlantis.yaml file if explicitly allowed by a
server side repo config.

The repo config file provides the ability to specify a default set of
workflows, and default values for apply_requirements and workflow to use
use on a per repo basis.  It also supports applying to a collection of
repos by using regex to match a repo name.

If more than one repo name matches, the values from last repo matched
are used.

This deprecates the --allow-repo-config option
2019-03-27 14:47:48 -05:00
Luke Kysow
fa4aad4a74 Refine basepath changes.
- Refactoring work from https://github.com/runatlantis/atlantis/pull/314
- Use just the path in templates, not the fully qualified URL since that
is a best practice.
- Add logging to errors when rendering templates.
- Silence help output on cli errors since the help output is now so
large that you have to scroll up to see the errors.
2018-11-21 11:33:31 -06:00
Jonathan Lange
670131fa63 Prefix URLs in templates with AtlantisURL
Resolves #213

Allows users to run Atlantis behind a shared reverse proxy, which is a fairly
common use case.
2018-11-06 11:03:58 +00:00
Luke Kysow
e9b7001266 Add godocs. Refactor ProjectResult. Golint errors. 2018-08-30 16:47:17 -06:00
Luke Kysow
1fc4667c63 WIP bitbucket 2018-07-19 21:52:33 +02:00
Luke Kysow
f9eeaa064e Add /healthz endpoint. 2018-07-04 18:44:17 +02:00
Luke Kysow
d3ec832eff WIP 2018-06-21 18:18:54 +01:00
Luke Kysow
2175b50472 Use new steps in plan/apply
- Fix lockURL issues by adding new Router object.
- Use new ProjectLocker and delete PreProjectExecutor.
2018-06-05 19:39:10 +01:00
Luke Kysow
143fb82bd2 Use new mux.SetURLVars function for testing. 2018-05-30 18:48:12 +02:00
mo-hit
9df3609e6e WIP Implement commenting on pull when lock deleted. 2018-05-30 16:28:58 +02:00
Luke Kysow
8aca81966f Add Apache 2 license and copyright.
Add Apache 2 license and Hootsuite copyright to all golang
files. Add a disclaimer that the files have been modified
hereafter by contributors to this repo in order to abide
by the Apache 2 license requirements.
2018-03-15 17:25:02 -07:00
Paul Salaberria
1154a09536 Rename config structs
- Config to UserConfig
- FlagNames to Config
- Use AtlantisVersion to be clear
2018-03-11 23:38:33 +01:00
Paul Salaberria
d8f5ff71f3 Show atlantis version in index page 2018-03-11 23:12:37 +01:00
Luke Kysow
35d3e14124 Add --allow-fork-prs option. Default to false.
Operating on forked pull requests is dangerous if it's a public repo
because anyone can make a pull request to a public repo. We default to
false like CircleCI and TravisCI who don't allow credentials to be
available on fork PRs.
2018-03-06 20:09:55 -08:00
Luke Kysow
6c159feff4 Rename to runatlantis from atlantisnorth. 2018-02-18 21:28:18 -08:00
Luke Kysow
0299d3ee12 Move to new atlantisnorth repo 2018-02-06 13:29:36 -08:00
Luke Kysow
7c1220a655 Rename from environment to workspace 2017-12-17 16:46:49 -08:00
Luke Kysow
fa43febf60 Gitlab (#190)
Gitlab initial implementation
2017-11-16 13:22:28 -08:00
Luke Kysow
3528ce60ca Fix gometalint errors 2017-11-01 07:43:55 -07:00
Luke Kysow
65a07590de Test server 2017-11-01 07:41:37 -07:00