Skip to content

Commit 3b8a07d

Browse files
authored
Add CI. Remove unused brainstore variables (#73)
* Setup precommit hooks for tf docs * Remove backfill debug + unused bstore params * Add github actions CI checks * Use mise in precommit to logic matches * Remove values from catchup etl
1 parent c07153f commit 3b8a07d

File tree

10 files changed

+45
-55
lines changed

10 files changed

+45
-55
lines changed

.github/workflows/terraform-ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Terraform CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
terraform:
11+
name: Terraform Lint & Validate
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Mise
19+
uses: jdx/mise-action@v2
20+
21+
- name: Run setup task
22+
run: mise run setup
23+
24+
- name: Run lint task
25+
run: mise run lint
26+
27+
- name: Run validate task
28+
run: mise run validate

.pre-commit-config.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
repos:
2-
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.88.0 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases
2+
- repo: local
43
hooks:
5-
- id: terraform_fmt
6-
- id: terraform_tflint
4+
- id: mise-lint
5+
name: mise lint
6+
entry: mise
7+
args: ["run", "lint"]
8+
language: system
9+
pass_filenames: false
10+
- repo: https://github.com/terraform-docs/terraform-docs
11+
rev: v0.12.0
12+
hooks:
13+
- id: terraform-docs-go
14+
args: ["."]

.terraform-docs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
formatter: "markdown document"
22
sections:
33
show: ['header', 'inputs', 'outputs']
4+
output:
5+
mode: "replace"
6+
file: "module-docs.md"

.tflint.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ plugin "terraform" {
55

66
plugin "aws" {
77
enabled = true
8-
version = "0.37.0"
8+
version = "0.40.0"
99
source = "github.com/terraform-linters/tflint-ruleset-aws"
1010
}

main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ module "services" {
110110
brainstore_port = var.enable_brainstore ? module.brainstore[0].port : null
111111
brainstore_enable_historical_full_backfill = var.brainstore_enable_historical_full_backfill
112112
brainstore_backfill_new_objects = var.brainstore_backfill_new_objects
113-
brainstore_backfill_disable_historical = var.brainstore_backfill_disable_historical
114-
brainstore_backfill_disable_nonhistorical = var.brainstore_backfill_disable_nonhistorical
115113
brainstore_etl_batch_size = var.brainstore_etl_batch_size
116114

117115
# Service configuration

modules/services/lambda-aiproxy.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "aws_lambda_function" "ai_proxy" {
88
role = aws_iam_role.api_handler_role.arn
99
handler = "index.handler"
1010
runtime = "nodejs22.x"
11-
architectures = ["arm64"]
11+
architectures = ["arm64"]
1212
memory_size = 1024
1313
reserved_concurrent_executions = var.ai_proxy_reserved_concurrent_executions
1414
timeout = 900

modules/services/lambda-apihandler.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ resource "aws_lambda_function" "api_handler" {
6969
BRAINSTORE_REALTIME_WAL_BUCKET = local.brainstore_s3_bucket
7070
BRAINSTORE_ENABLE_HISTORICAL_FULL_BACKFILL = var.brainstore_enable_historical_full_backfill
7171
BRAINSTORE_BACKFILL_NEW_OBJECTS = var.brainstore_backfill_new_objects
72-
BRAINSTORE_BACKFILL_DISABLE_HISTORICAL = var.brainstore_backfill_disable_historical
73-
BRAINSTORE_BACKFILL_DISABLE_NONHISTORICAL = var.brainstore_backfill_disable_nonhistorical
7472

7573
CLICKHOUSE_PG_URL = local.clickhouse_pg_url
7674
CLICKHOUSE_CONNECT_URL = local.clickhouse_connect_url

modules/services/lambda-catchup-etl.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ resource "aws_lambda_function" "catchup_etl" {
2626
BRAINSTORE_REALTIME_WAL_BUCKET = local.brainstore_s3_bucket
2727
BRAINSTORE_ENABLE_HISTORICAL_FULL_BACKFILL = var.brainstore_enable_historical_full_backfill
2828
BRAINSTORE_BACKFILL_NEW_OBJECTS = var.brainstore_backfill_new_objects
29-
BRAINSTORE_BACKFILL_DISABLE_HISTORICAL = var.brainstore_backfill_disable_historical
30-
BRAINSTORE_BACKFILL_DISABLE_NONHISTORICAL = var.brainstore_backfill_disable_nonhistorical
3129
CLICKHOUSE_ETL_BATCH_SIZE = var.brainstore_etl_batch_size
3230
CLICKHOUSE_PG_URL = local.clickhouse_pg_url
3331
CLICKHOUSE_CONNECT_URL = local.clickhouse_connect_url

modules/services/variables.tf

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,6 @@ variable "brainstore_backfill_new_objects" {
221221
default = true
222222
}
223223

224-
variable "brainstore_backfill_disable_historical" {
225-
type = bool
226-
description = "Disable historical backfill for Brainstore"
227-
default = false
228-
}
229-
230-
variable "brainstore_backfill_disable_nonhistorical" {
231-
type = bool
232-
description = "Disable non-historical backfill for Brainstore"
233-
default = false
234-
}
235-
236224
variable "brainstore_etl_batch_size" {
237225
type = number
238226
description = "The batch size for the ETL process"
@@ -249,25 +237,6 @@ variable "brainstore_default" {
249237
}
250238
}
251239

252-
variable "brainstore_disable_optimization_worker" {
253-
type = bool
254-
description = "Whether to disable the optimization worker in Brainstore"
255-
default = false
256-
}
257-
258-
variable "brainstore_enable_index_validation" {
259-
type = bool
260-
description = "Enable index validation for Brainstore"
261-
default = false
262-
}
263-
264-
variable "brainstore_index_validation_only_deletes" {
265-
type = bool
266-
description = "Scope index validation to only deletes in Brainstore. Only applies if brainstore_enable_index_validation is true"
267-
default = true
268-
}
269-
270-
271240
variable "lambda_version_tag_override" {
272241
description = "Optional override for the lambda version tag. If not provided, will use locked versions from VERSIONS.json"
273242
type = string

variables.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,18 +347,6 @@ variable "brainstore_backfill_new_objects" {
347347
default = true
348348
}
349349

350-
variable "brainstore_backfill_disable_historical" {
351-
type = bool
352-
description = "Disable historical backfill for Brainstore. Don't modify this unless instructed by Braintrust."
353-
default = false
354-
}
355-
356-
variable "brainstore_backfill_disable_nonhistorical" {
357-
type = bool
358-
description = "Disable non-historical backfill for Brainstore. Don't modify this unless instructed by Braintrust."
359-
default = false
360-
}
361-
362350
variable "brainstore_etl_batch_size" {
363351
type = number
364352
description = "The batch size for the ETL process"

0 commit comments

Comments
 (0)