Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: Add minimal terraform project#308

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

bryphe-coder
Copy link
Contributor

I was thinking it might be nice to have some example projects (especially as we on-board new developers) to make it easy to create new projects.

This adds the most basic possible terraform module... just an output block. However, it's enough to runcoder projects create and go through the whole lifecycle of creating a project and workspace (although, it's really boring since there are no parameters).

The folder structure I added looks like this:

  • examples
    • minimal-project

Open to ideas though - other possibilities:

  • We could keep these in a separate repo
  • We could keep them in a notion doc

@codecov
Copy link

codecovbot commentedFeb 17, 2022
edited
Loading

Codecov Report

Merging#308 (4deb0ad) intomain (e5db936) willincrease coverage by2.58%.
The diff coverage isn/a.

Impacted file tree graph

@@            Coverage Diff             @@##             main     #308      +/-   ##==========================================+ Coverage   64.81%   67.39%   +2.58%==========================================  Files          67      140      +73       Lines         756     7407    +6651       Branches       74       77       +3     ==========================================+ Hits          490     4992    +4502- Misses        251     1904    +1653- Partials       15      511     +496
FlagCoverage Δ
unittest-go-macos-latest66.24% <ø> (?)
unittest-go-ubuntu-latest67.28% <ø> (?)
unittest-go-windows-latest65.77% <ø> (?)
unittest-js63.61% <ø> (-1.21%)⬇️
Impacted FilesCoverage Δ
site/components/SignIn/index.tsx0.00% <0.00%> (ø)
provisionersdk/serve.go35.13% <0.00%> (ø)
cryptorand/numbers.go46.90% <0.00%> (ø)
coderd/projects.go62.64% <0.00%> (ø)
coderd/coderd.go95.28% <0.00%> (ø)
cryptorand/strings.go80.64% <0.00%> (ø)
peerbroker/listen.go84.80% <0.00%> (ø)
coderd/projectimport.go59.39% <0.00%> (ø)
site/embed.go83.14% <0.00%> (ø)
cli/projectplan.go62.50% <0.00%> (ø)
... and65 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatee5db936...4deb0ad. Read thecomment docs.

@@ -0,0 +1,8 @@
terraform {
required_version=">= 0.12.26"

Choose a reason for hiding this comment

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

Unrelated to your change, but this brings up a few questions for me:

  • Do we anticipate that we'll need to be able to handle multiple different versions of Terraform being co-installed? I don't know what their compatibility story is like
  • Do we expect that each project will have one (and only one) Terraform file? Of course it can include submodules, but if the amount of infrastructure managed by a given project grows too much, it can make things really slow

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Good questions!

Do we anticipate that we'll need to be able to handle multiple different versions of Terraform being co-installed?

I believe ourprovisionerd will be tied to a certain version ofterraform, but I could be wrong. We'll need to communicate out a requirement as to whatterraform binary needs to be available. It'd be great to have a health-check, too, to verify that terraform is in the environment and at a supported version.

Do we expect that each project will have one (and only one) Terraform file? Of course it can include submodules, but if the amount of infrastructure managed by a given project grows too much, it can make things really slow

I suspect most projects will have more terraform files than in the example. Theproject create workflow zips up the entire folder into atar.gz, and sends it as collateral for the command - so we support having more than just a single file.

-`.github/`: Settings for[Dependabot for updating dependencies](https://docs.github.com/en/code-security/supply-chain-security/customizing-dependency-updates) and[build/deploy pipelines with GitHub Actions](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions).
-[`semantic.yaml`](./github/semantic.yaml): Configuration for[semantic pull requests](https://github.com/apps/semantic-pull-requests)
-[`semantic.yaml`](./github/semantic.yaml): Configuration for[semantic pull requests](https://github.com/apps/semantic-pull-requests)\
-`examples`: Example terraform project templates.
Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking we'll eventually rename this totemplates (once that product functionality exists), but this is great for now!

jawnsy and bryphe-coder reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Cool! I'll switch it over as part of this PR, so we're closer to the ideal.

Copy link
ContributorAuthor

@bryphe-coderbryphe-coderFeb 17, 2022
edited
Loading

Choose a reason for hiding this comment

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

Actually I totally missed that we already have atemplates folder (with asimple example like this PR has) - introduced here#246

That does the same job as this PR - so I'll close this out and usetemplates/null in my workflow

@bryphe-coder
Copy link
ContributorAuthor

Closing this because there is alreadytemplates/null/main.tf which does the same job as this PR

@bryphe-coder
Copy link
ContributorAuthor

From discussion in#318 (comment) - I'll bring this back and keep it inexamples. As they mature, we can refine them and move them to atemplates folder

@bryphe-coderbryphe-coder merged commit4c71ff9 intomainFeb 18, 2022
@bryphe-coderbryphe-coder deleted the bryphe/refactor/add-minimal-project-example branchFebruary 18, 2022 05:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@kylecarbskylecarbskylecarbs approved these changes

+1 more reviewer

@jawnsyjawnsyjawnsy left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@bryphe-coder@jawnsy@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp