Skip to content

breaking(terraform-server): update terraform module to match Canonical Spec#1007

Open
rene-oromtz wants to merge 6 commits intomainfrom
feat/update-server-terraform
Open

breaking(terraform-server): update terraform module to match Canonical Spec#1007
rene-oromtz wants to merge 6 commits intomainfrom
feat/update-server-terraform

Conversation

@rene-oromtz
Copy link
Copy Markdown
Contributor

@rene-oromtz rene-oromtz commented Apr 7, 2026

Description

This PR updates the terraform files for server module aligning with the standards defined in CC008 specification.

Changes introduced:

  • README.md: updated to be aligned with the requirements in Spec including variables, inputs and outputs.
  • main.tf: modify file to include required variables, including using model_uuid instead of model name.
  • providers.tf: Empty file just for matching spec requirements
  • terraform.tf: renamed versions.tf to terraform.tf as required by spec. It also includes the use of "any" Terraform provider in 1.x version as all charm modules should be above 1.0.0 version.
  • output.tf: included application, provides and requires from charm application.
  • variables.tf: This includes all the required variables in alphabetical order
  • locals.tf: Empty file just for matching spec requirements
  • CONTRIBUTING.md: Updated with instruction on how to deploy server locally via Terraform
  • terraform/dev directory added as well for simplifying local testing.
  • tag action: added so this can be semantically tagged on module modification, since this is breaking change, the pattern will release testflinger-k8s-1.0.0

Resolved issues

Resolves CERTTF-896

Documentation

Updated CONTRIBUTING.md and README.md for Terraform module

Web service API changes

Tests

Tested locally to deploy a fresh installation following CONTRIBUTING.md:

multipass exec testflinger-juju -- juju status --storage --relations
Model            Controller            Cloud/Region        Version  SLA          Timestamp
testflinger-dev  localhost-controller  microk8s/localhost  3.6.20   unsupported  12:58:37-06:00

SAAS     Status  Store  URL
mongodb  active  local  admin/testflinger-dev-db.mongodb

App          Version  Status   Scale  Charm                     Channel        Rev  Address         Exposed  Message
ingress      24.2.0   active       1  nginx-ingress-integrator  latest/stable  203  10.152.183.136  no       Ingress IP(s): 127.0.0.1
testflinger           waiting      2  testflinger-k8s           latest/beta    283  10.152.183.38   no       Waiting for Pebble in workload container

Unit            Workload  Agent      Address      Ports  Message
ingress/0*      active    idle       10.1.124.22         Ingress IP(s): 127.0.0.1
testflinger/0   waiting   executing  10.1.124.23         Waiting for Pebble in workload container
testflinger/1*  waiting   idle       10.1.124.24         Waiting for Pebble in workload container

Integration provider  Requirer                    Interface       Type     Message
ingress:nginx-peers   ingress:nginx-peers         nginx-instance  peer     
ingress:nginx-route   testflinger:nginx-route     nginx-route     regular  
mongodb:database      testflinger:mongodb_client  mongodb_client  regular  

Additionally, tested on staging via this run

Some migrations needs to be performed but this on deployment side and not on this module, what is important is that no modification are made:

Plan: 0 to add, 0 to change, 0 to destroy.

@rene-oromtz rene-oromtz changed the title Feat/update server terraform breaking(terraform-server): update testflinger terraform module to match Canonical Spec Apr 7, 2026
@rene-oromtz rene-oromtz changed the title breaking(terraform-server): update testflinger terraform module to match Canonical Spec breaking(terraform-server): update terraform module to match Canonical Spec Apr 7, 2026
@rene-oromtz rene-oromtz requested a review from Copilot April 7, 2026 23:04
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.32%. Comparing base (9eb2f40) to head (22391ba).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1007      +/-   ##
==========================================
+ Coverage   75.24%   75.32%   +0.08%     
==========================================
  Files         110      111       +1     
  Lines       10757    10988     +231     
  Branches      898      927      +29     
==========================================
+ Hits         8094     8277     +183     
- Misses       2467     2502      +35     
- Partials      196      209      +13     
Flag Coverage Δ *Carryforward flag
agent 74.72% <ø> (ø) Carriedforward from 11eecb2
cli 90.40% <ø> (ø) Carriedforward from 11eecb2
device 62.52% <ø> (ø) Carriedforward from 11eecb2
server 87.05% <ø> (-1.06%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Components Coverage Δ
Agent 74.72% <ø> (ø)
CLI 90.40% <ø> (ø)
Common ∅ <ø> (∅)
Device Connectors 62.52% <ø> (ø)
Server 87.05% <ø> (-1.06%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the server/terraform module to match a Canonical Terraform module “spec” style interface (explicit model_uuid, generic config, etc.), updates the Juju Terraform provider requirement, and adds supporting documentation + automation for module version tagging.

Changes:

  • Reworked the server module inputs to a smaller “canonical” surface (app_name, model_uuid, config, etc.) and simplified the deployment resources.
  • Added module outputs (application, provides, requires) plus a dev/ higher-level example for local deployment.
  • Added a GitHub Actions workflow to auto-tag module versions based on commit semantics.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
server/terraform/variables.tf Replaces environment-driven inputs with canonical module inputs (model_uuid, config, etc.).
server/terraform/main.tf Simplifies to a single juju_application for the server charm using the new inputs.
server/terraform/outputs.tf Introduces module outputs for application object and integration endpoint maps.
server/terraform/terraform.tf Bumps required Juju provider version constraint to ~> 1.0.
server/terraform/README.md Replaces local deployment instructions with module API/usage documentation.
server/terraform/CONTRIBUTING.md Adds module-specific contribution and local deployment guidance.
server/terraform/dev/main.tf Adds a higher-level dev example wiring ingress + MongoDB offer integration.
server/terraform/dev/variables.tf Adds dev-only variables for secrets used in the example.
server/terraform/dev/terraform.tf Pins dev example to Juju provider ~> 1.0.
server/terraform/dev/cloud-init.yaml Updates MongoDB charm channel used in dev bootstrap steps.
server/terraform/dev/.gitignore Adds .terraform.lock.hcl and standard Terraform ignores for dev.
.github/workflows/server-terraform-tags.yml Adds auto-tagging workflow for the server Terraform module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rene-oromtz rene-oromtz force-pushed the feat/update-server-terraform branch 3 times, most recently from 1ed4eff to 11eecb2 Compare April 8, 2026 22:29
@rene-oromtz rene-oromtz marked this pull request as ready for review April 8, 2026 22:43
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