Chore/refactor with enhancements#37
Conversation
c01ccf0 to
6c09350
Compare
There was a problem hiding this comment.
Pull request overview
Refactors the staging Terraform stack to use reusable VPC/EKS modules and adds repo-wide automation improvements (pre-commit, lint/test workflows, and release tooling), along with minor Go formatting/tidy updates for the Inventory service.
Changes:
- Replace inline staging VPC/EKS resources with
infrastructure/modules/vpcandinfrastructure/modules/ekswrappers aroundterraform-aws-modules/*. - Add Inventory CI (lint/test/release), Go lint config, and a generated changelog workflow.
- Update Orders workflows (tag naming convention, pre-release automation, and CI improvements) and expand pre-commit hooks.
Reviewed changes
Copilot reviewed 34 out of 40 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| infrastructure/staging/vpc.tf | Switch staging VPC to use the new VPC module with EKS subnet tags and NAT config. |
| infrastructure/staging/subnets.tf | Removed (subnets now created by VPC module). |
| infrastructure/staging/routes.tf | Removed (route tables now managed by VPC module). |
| infrastructure/staging/nat.tf | Removed (NAT gateway/EIP now managed by VPC module). |
| infrastructure/staging/igw.tf | Removed (IGW now managed by VPC module). |
| infrastructure/staging/eks.tf | Switch staging EKS to use the new EKS module and managed node groups map. |
| infrastructure/staging/nodes.tf | Removed (node groups now managed by EKS module). |
| infrastructure/staging/providers.tf | Update Helm provider config to use module outputs + AWS exec auth; bump AWS provider constraint. |
| infrastructure/staging/pod-identity-addon.tf | Point addon to module.eks.cluster_name. |
| infrastructure/staging/outputs.tf | Rewire outputs from raw resources to module outputs; add OIDC provider output; drop some removed outputs. |
| infrastructure/staging/locals.tf | Adjust cluster naming local (no longer appends “-cluster”). |
| infrastructure/staging/argocd.tf | Helm releases now depend on module.eks instead of a node group resource. |
| infrastructure/staging/argocd-image-updater.tf | Update IAM role naming and pod identity association to use module cluster name. |
| infrastructure/staging/argocd-external-secrets-provider.tf | Update cluster references to module outputs; keep bootstrap kubectl null_resources. |
| infrastructure/modules/vpc/versions.tf | New module provider/version constraints for VPC wrapper. |
| infrastructure/modules/vpc/variables.tf | New VPC wrapper inputs (CIDR/subnets/NAT/DNS/tags, etc.). |
| infrastructure/modules/vpc/main.tf | Wrap terraform-aws-modules/vpc/aws v6.6.0 with standardized tagging. |
| infrastructure/modules/vpc/outputs.tf | Expose common VPC outputs from the wrapped module. |
| infrastructure/modules/vpc/README.md | Document VPC wrapper usage and inputs/outputs. |
| infrastructure/modules/eks/versions.tf | New module provider/version constraints for EKS wrapper. |
| infrastructure/modules/eks/variables.tf | New EKS wrapper inputs (name/VPC/subnets/node groups/tags/log retention). |
| infrastructure/modules/eks/main.tf | Wrap terraform-aws-modules/eks/aws v21.14.0 with logging/KMS/IRSA defaults. |
| infrastructure/modules/eks/outputs.tf | Expose common EKS outputs from the wrapped module. |
| infrastructure/modules/eks/README.md | Document EKS wrapper usage and inputs/outputs. |
| apps/inventory/internal/service/inventory_service.go | Formatting-only alignment of exported error vars. |
| apps/inventory/internal/models/models.go | Formatting-only alignment of struct fields/tags. |
| apps/inventory/internal/handler/inventory_handler.go | Fix gofmt issue in AddStockRequest declaration. |
| apps/inventory/internal/events/events.go | Formatting-only alignment of event structs. |
| apps/inventory/internal/events/event_handler.go | Formatting-only alignment in low-stock alert event initialization. |
| apps/inventory/go.mod | Reorganize dependencies: promote key deps to direct requirements, tidy indirects. |
| apps/inventory/go.sum | Updated sums consistent with module tidy/dependency graph changes. |
| apps/inventory/CHANGELOG.md | Add initial changelog scaffold for git-chglog-based release process. |
| apps/inventory/.golangci.yml | Add golangci-lint configuration for Inventory service. |
| .pre-commit-config.yaml | Add Go (Inventory) and TS (Orders) hooks; expand shared checks; exclude node_modules. |
| .github/workflows/orders-release.yml | Change tag format to orders/v*.*.*, update version extraction, bump GH release action. |
| .github/workflows/orders-pre-release.yml | Add workflow to prepare Orders release (version bump + changelog + PR). |
| .github/workflows/orders-lint.yml | Tighten PR event types, add TypeScript typecheck, soften Codecov failure behavior. |
| .github/workflows/inventory-release.yml | Add Inventory release workflow for inventory/v*.*.* tags (test/build/push/release). |
| .github/workflows/inventory-pre-release.yml | Add Inventory pre-release workflow (git-chglog + branch + PR). |
| .github/workflows/inventory-lint.yml | Add Inventory CI workflow (tidy/format/lint/vulncheck/tests + coverage upload). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@basebandit I've opened a new pull request, #38, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@basebandit I've opened a new pull request, #39, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@basebandit I've opened a new pull request, #40, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@basebandit I've opened a new pull request, #41, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@basebandit I've opened a new pull request, #42, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan * feat(eks): add missing input variables to align with README documentation Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com>
* Initial plan * feat(eks): make kubernetes_version configurable via variable Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com>
* Initial plan * feat(eks): make endpoint access configurable via module inputs - Add endpoint_public_access and endpoint_private_access variables - Add cluster_version variable for Kubernetes version - Update main.tf to use variables instead of hardcoded values - Set secure defaults (private-only access) for backward compatibility - Update README to reflect correct variable names and defaults Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com>
* Initial plan * fix(terraform): add guards to NAT gateway outputs for resilience Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com>
* Initial plan * fix(terraform): guard NAT gateway outputs with try() for when NAT is disabled Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com>
No description provided.