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

Allow slashes in project names #338

Merged
merged 2 commits into from
Oct 30, 2018
Merged

Allow slashes in project names #338

merged 2 commits into from
Oct 30, 2018

Conversation

lkysow
Copy link
Member

@lkysow lkysow commented Oct 30, 2018

Allow the project name in atlantis.yaml file to contain slashes:

projects:
- dir: terraform/myservice
  name: terraform/myservice

Also in this PR:

  • Validate project names to ensure they don't contain invalid characters
  • Ensure the planfile names (which are generated from the project names) don't contain invalid filename chars

Notes

johnlinvc and others added 2 commits October 30, 2018 11:43
We should only allow project names (which are specified in an
atlantis.yaml file) that don't need to be url escaped. The one
exceptional character is '/' which we allow because users like to name
their projects to match the directory they're in. We use the same rule
that Terraform uses for workspace names.

I've also changed the characters that are replaced when writing out the
plan filename to only remove invalid filename characters instead of just
allowing alphanumeric. This is the smallest amount of change required to
ensure the filename is valid.
@codecov
Copy link

codecov bot commented Oct 30, 2018

Codecov Report

Merging #338 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
+ Coverage   70.57%   70.63%   +0.06%     
==========================================
  Files          61       61              
  Lines        3643     3651       +8     
==========================================
+ Hits         2571     2579       +8     
  Misses        893      893              
  Partials      179      179
Impacted Files Coverage Δ
server/events/yaml/raw/project.go 100% <100%> (ø) ⬆️
server/events/runtime/runtime.go 83.33% <100%> (+5.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a91af8b...2d214b2. Read the comment docs.

@lkysow lkysow merged commit 6af4d79 into master Oct 30, 2018
@lkysow lkysow deleted the projectname branch October 30, 2018 18:10
This was referenced Oct 30, 2018
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.

2 participants