add module publishing and templating system#6
Merged
Merged
Conversation
Ravion Module Publish PlanDry run only. No Ravion API mutations were made.
Diffsrvn-aws-acm-certificate@0.0.2 Create Version--- remote
+++ compiled
- id: section_misc
label: Misc
type: section
- - description: Additional tags for the ACM certificate. Ravion also adds Owner, ProjectGivenId, EnvironmentGivenId, ModuleGivenId, and ModuleId tags.
+ - description: A map of tags to assign to all resources. Default tags are `Owner`, `project_given_id`, `environment_given_id`, `module_given_id`, `module_unique_id`
id: tags
label: Tags
required: false
type: keyvalue
- id: section_advanced
- label: Terraform Settings
+ label: Terraform settings
type: section
- collapsible: true
- description: Override the VPC, subnet, and security group for Pipeline Terraform runners. Must use the same AWS account as selected above.
- id: execution_environment_id
- label: Terraform Execution Environment
+ description: Override the environment's default version for this module
+ id: opentofu_version
+ label: OpenTofu version override
+ required: false
type: string
- values: $values:ravion/execution_environments
+ values: $values:opentofu/versions
+ - collapsible: true
+ description: Override Terraform state backend workspace name. Defaults to project + environment + module given ids.
+ id: ravion_state_backend_workspace
+ label: Ravion Terraform workspace name
+ type: string
- default: {}
description: Optional raw Terraform variable overrides for advanced module inputs or one-off overrides. Values here override the generated variables above.
id: advanced_terraform_variables
@@
required: false
type: object
- collapsible: true
- description: Override Terraform state backend workspace name. Defaults to project + environment + module given ids.
- id: ravion_state_backend_workspace
- label: Ravion Terraform workspace name
+ description: Override the VPC, subnet, and security group for Pipeline Terraform runners. Must use the same AWS account as selected above.
+ id: execution_environment_id
+ label: Terraform Execution Environment
type: string
+ values: $values:ravion/execution_environments
readme: |
ACM certificate requests an AWS Certificate Manager public certificate with DNS validation.
@@
ProjectGivenId: <<project.given_id>>
wait_for_validation: << module.input.wait_for_validation >>
tool: opentofu
- tool_version: <<defaults.opentofu_version >>
+ tool_version: << module.input.opentofu_version || defaults.opentofu_version >>
variant: standard
destroy:
pipeline_id: << defaults.destroy_pipeline_id >>rvn-aws-network@0.0.4 Create Version--- remote
+++ compiled
required: false
type: object_map
- id: section_advanced
- label: Terraform Settings
+ label: Terraform settings
type: section
- collapsible: true
- description: Override the VPC, subnet, and security group for Pipeline Terraform runners. Must have same AWS account as selected above.
- id: execution_environment_id
- label: Terraform Execution Environment
- type: string
- values: $values:ravion/execution_environments
- - collapsible: true
description: Override the environment's default version for this module
id: opentofu_version
- label: OpenTofu Version Override
+ label: OpenTofu version override
required: false
type: string
values: $values:opentofu/versions
+ - collapsible: true
+ description: Override Terraform state backend workspace name. Defaults to project + environment + module given ids.
+ id: ravion_state_backend_workspace
+ label: Ravion Terraform workspace name
+ type: string
+ - default: {}
+ description: Optional raw Terraform variable overrides for advanced module inputs or one-off overrides. Values here override the generated variables above.
+ id: advanced_terraform_variables
+ label: Advanced Terraform variables
+ required: false
+ type: object
+ - collapsible: true
+ description: Override the VPC, subnet, and security group for Pipeline Terraform runners. Must have same AWS account as selected above.
+ id: execution_environment_id
+ label: Terraform Execution Environment
+ type: string
+ values: $values:ravion/execution_environments
readme: |
Production-ready AWS VPC with public and private subnets, NAT gateways, and compliance-ready flow logs.
@@
repo: https://github.com/flightcontrolhq/modules
stack_id: <<stack.id>>
terraform_variables:
+ ...overrides: << module.input.advanced_terraform_variables >>
enable_flow_logs: << module.input.enable_flow_logs >>
enable_nat_gateway: << module.input.enable_nat_gateway >>
name: << module.input.name >>
@@
variant: standard
destroy:
pipeline_id: << defaults.destroy_pipeline_id >>
- ravion_state_backend_workspace: << project.given_id + "-" + environment.given_id + "-" + module.given_id + "-" + stack.id >>
+ ravion_state_backend_workspace: << module.input.ravion_state_backend_workspace || project.given_id + "-" + environment.given_id + "-" + module.given_id + "-" + stack.id>>
type: opentofurvn-aws-static@0.0.2 Create Version--- remote
+++ compiled
label: Terraform settings
type: section
- collapsible: true
- description: Override the execution environment for Terraform runners. Must use the same AWS account as selected above.
- id: execution_environment_id
- label: Terraform execution environment
- required: false
- type: string
- values: $values:ravion/execution_environments
- - collapsible: true
- default: $values:first
+ description: Override the environment's default version for this module
id: opentofu_version
- label: OpenTofu version
+ label: OpenTofu version override
+ required: false
type: string
values: $values:opentofu/versions
- collapsible: true
@@
id: ravion_state_backend_workspace
label: Ravion Terraform workspace name
type: string
- - collapsible: true
- default: {}
+ - default: {}
+ description: Optional raw Terraform variable overrides for advanced module inputs or one-off overrides. Values here override the generated variables above.
id: advanced_terraform_variables
label: Advanced Terraform variables
+ required: false
type: object
- collapsible: true
- description: Additional tags for all resources. Ravion also adds Owner, ProjectGivenId, EnvironmentGivenId, ModuleGivenId, and ModuleId tags.
+ description: Override the execution environment for Terraform runners. Must use the same AWS account as selected above.
+ id: execution_environment_id
+ label: Terraform execution environment
+ required: false
+ type: string
+ values: $values:ravion/execution_environments
+ - collapsible: true
+ description: A map of tags to assign to all resources. Default tags are `Owner`, `project_given_id`, `environment_given_id`, `module_given_id`, `module_unique_id`
id: tags
label: Tags
required: false
@@
Owner: Ravion
ProjectGivenId: <<project.given_id>>
tool: opentofu
- tool_version: << module.input.opentofu_version >>
+ tool_version: << module.input.opentofu_version || defaults.opentofu_version >>
variant: standard
destroy:
pipeline_id: << defaults.destroy_pipeline_id >>rvn-ecs-cluster@0.0.3 Create Version--- remote
+++ compiled
- id: section_misc
label: Misc
type: section
- - description: Additional tags for all resources. Ravion also adds Owner, ProjectGivenId, EnvironmentGivenId, ModuleGivenId, and ModuleId tags.
+ - description: A map of tags to assign to all resources. Default tags are `Owner`, `project_given_id`, `environment_given_id`, `module_given_id`, `module_unique_id`
id: tags
label: Tags
required: false
type: keyvalue
- - default: {}
- description: Optional raw Terraform variable overrides for advanced module inputs or one-off overrides. Values here override the generated variables above.
- id: advanced_terraform_variables
- label: Advanced Terraform variables
- required: false
- type: object
- id: section_advanced
label: Terraform settings
type: section
- collapsible: true
- description: Override the environment's default OpenTofu version for this module.
+ description: Override the environment's default version for this module
id: opentofu_version
label: OpenTofu version override
required: false
@@
id: ravion_state_backend_workspace
label: Ravion Terraform workspace name
type: string
+ - default: {}
+ description: Optional raw Terraform variable overrides for advanced module inputs or one-off overrides. Values here override the generated variables above.
+ id: advanced_terraform_variables
+ label: Advanced Terraform variables
+ required: false
+ type: object
readme: |-
Production-ready AWS ECS cluster with Fargate, Fargate Spot, optional EC2 capacity, and shared load balancers.
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Greptile Summary
This PR introduces a full module authoring, compilation, and publishing pipeline — converting the repo from hand-maintained
module.ymlfiles to a structureddefinition.ymlformat with a YAML composition system (includes, merges, templates) and a CLI toolchain that validates, compiles, tags, and publishes versioned module definitions to the Ravion API.authoring-schema.tsvalidates definition files,compiler.tsresolves$include/$merge/$templatedirectives recursively with cycle detection, andmodule-schema.tsvalidates the compiled output against the canonical module shape.release.tsdiffs local compiled configs against the remote inventory,tags.tscreates annotated git tags per module version, andpublish.tscreates/patches remote definitions and versions via HTTP — all wired together in the GitHub Actions workflow.guardrails.tsblocks re-introduction of the oldmodule.ymlformat by scanning the repo for YAML files that look like legacy definitions.Confidence Score: 3/5
Safe to merge for current module definitions (all stable versions), but the pre-release version sorting bug is a latent defect that would silently write wrong definition files if pre-release versions are ever published alongside their stable counterparts.
The
compareSemverfunction strips pre-release suffixes viaparseIntand then falls back to lexicographic comparison, which ranks "1.0.0-alpha" above "1.0.0" — the inverse of correct semver precedence. The authoring schema explicitly permits pre-release versions, so this path is reachable without any schema changes. Incorrect version selection inselectLatestVersionwould propagate into generateddefinition.ymlfiles without any warning.tools/ravion-modules/src/generate-definitions.ts — specifically the
compareSemverandselectLatestVersionfunctions.Important Files Changed
Sequence Diagram
sequenceDiagram participant GH as GitHub Actions participant CLI as ravion-modules CLI participant FS as Filesystem (definition.yml) participant API as Ravion API participant Git as git GH->>CLI: compile (validate job) CLI->>FS: findDefinitionFiles() FS-->>CLI: definition.yml paths CLI->>FS: parseAuthoringDefinitionFile + resolveValue CLI-->>GH: CompiledDefinition[] GH->>CLI: tags --api --create (publish job) CLI->>API: listModuleDefinitions / listModuleVersions API-->>CLI: RemoteModuleInventory CLI->>CLI: getReleaseStatuses → validateReleaseStatuses CLI->>CLI: planTags (filter unpublished) CLI->>Git: "git tag -a type@version" Git-->>CLI: ok GH->>Git: git push origin --tags GH->>CLI: publish --apply (publish job) CLI->>API: listModuleDefinitions / listModuleVersions API-->>CLI: RemoteModuleInventory CLI->>CLI: validateReleaseStatuses (conflict check) CLI->>API: createModuleDefinition (if new) CLI->>API: patchModuleDefinition (if metadata changed) CLI->>API: createModuleVersion (if unpublished) API-->>CLI: RemoteModuleVersionPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "extract partials" | Re-trigger Greptile