Repository navigation
2997-airbyte-review - #709
ColeJordan-mobilise wants to merge 1 commit into
Conversation
dfe-lance
left a comment
There was a problem hiding this comment.
Review of PR #709 at commit 164dd3f: REQUEST CHANGES
PR: #709
Title: 2997-airbyte-review
Author: ColeJordan-mobilise
Base: main
Verdict: REQUEST CHANGES
Summary
The PR adds the Airbyte module, provider, config and secrets to the Terraform and turns it on for the review app. It also bumps the dfe-analytics packages to 0.6.4 and adds DfeAnalytics.EFCore to the Persistence project. The .NET changes aren't mentioned in the description and aren't explained. I could only read the src tree in this checkout. Access to terraform/ was denied, so I reviewed the Terraform from the diff alone and give no line numbers for it. I did not run any terraform plan.
Blocking issues
Unexplained .NET changes.
The description lists only airbyte.tf, variables/secrets and the provider.
The diff also does the following:
It bumps DfeAnalytics.Core and DfeAnalytics.AspNetCore from 0.6.2 to 0.6.4.
It adds a new DfeAnalytics.EFCore reference to src/DfE.CheckPerformanceData.Persistence/DfE.CheckPerformanceData.Persistence.csproj.
It sets DfeAnalyticsDbContext in src/Directory.Build.props.
DfeAnalytics.EFCore brings in System.CommandLine, Npgsql.EntityFrameworkCore.PostgreSQL and Microsoft.Extensions.Http, and changes the System.CodeDom version.
The Directory.Build.props value points at PortalDbContext. That type exists in src/DfE.CheckPerformanceData.Persistence/Contexts/PortalDbContext.cs:12, so the reference resolves.
Nothing in src/**/*.cs uses the EFCore package yet. I couldn't tell what it's for, or whether it is meant to be part of this change.
Please explain it in the description. If it isn't needed for the Airbyte deploy, split it into its own PR so this one stays infrastructure-only.
The project's rules say there should be no Directory.Build.props. This repo already has one, but adding a property there still needs a stated reason.
Commit history breaks the project's rules.
The recent branch commits are all titled Feat:airbyte config.
The rules ban feat:-style prefixes and ask for terse messages in the shape of recent history.
They also require a work-item reference on every commit: AB#nnnnnn, a (nnnnnn) scope, a leading nnnn - , or Refs #n.
The Trello link in the description doesn't satisfy that. The PR title uses 2997, which looks like a Trello card number rather than an AB item, so please confirm what the correct reference is.
The description says "Cleaned commit history", but three identical commits remain. Please squash and reword them.
Policy tag IDs are hardcoded a second time in terraform/application/application.tf.
This PR creates local.gcp_taxonomy_id and local.gcp_policy_tag_id in variables.tf, and dfe_analytics.tf and airbyte.tf use them.
BIGQUERY_POLICY_TAGS then repeats the same IDs as a literal string, along with the project name and region.
If the taxonomy changes, the module and the app config will disagree without any error.
Build the string from the locals, using jsonencode instead of the hand-escaped JSON. Move the project ID check-performance-data and the region into locals or variables as well.
Suggestions
airbyte_enabled has no type.
variable "airbyte_enabled" { default = false } has no type or description. connection_status right below it has both.
Add type = bool and a description.
Do the same for the new server_version in variables.tf, which needs type = string.
Redundant guards.
Inside module "airbyte", the module already has count = var.airbyte_enabled ? 1 : 0.
The var.airbyte_enabled ? ... : null guards on workspace_id, client_id and the other secrets are therefore unnecessary. Drop them to simplify the file.
The provider block in terraform.tf still needs its guards, because a provider is always configured.
Duplicated server URL.
https://airbyte-${var.namespace}.${module.cluster_data.ingress_domain} is built in three places: airbyte.tf, application.tf and terraform.tf.
Put it in one local and add the /api/public/v1 suffix only where it's needed.
Dead code.
local.gcp_dataset_name is declared in airbyte.tf but only used for BIGQUERY_AIRBYTE_DATASET. Check that the module derives the same dataset name. If it names the dataset itself, the two could drift.
Delete the commented-out #use_legacy_dotnet_shim line.
Delete the stray # Configuration options comment in the provider block.
Formatting.
The secret_variables merge is laid out oddly, with a leading comma on its own line.
There is a double blank line in airbyte.tf.
Run terraform fmt.
Secrets enabled only for review.
review.tfvars.json sets airbyte_enabled to true, and pg_airbyte_enabled is already true in qa.tfvars.json and production.tfvars.json.
The new module reads five secrets (AIRBYTE-WORKSPACE-ID, AIRBYTE-CLIENT-ID, AIRBYTE-CLIENT-SECRET, AIRBYTE-REPLICATION-PASSWORD, AIRBYTE-BQ-SA) from infrastructure_secrets. These must exist in the review Key Vault before apply.
I couldn't verify they exist, because Key Vault is a runtime service I can't reach from here. Please say in the description how they get populated.
Provider pinning. airbytehq/airbyte is pinned to the exact version 0.10.0, matching the other providers. That's fine. Make sure the .terraform.lock.hcl is updated if the repo commits one.
Description. The description's "Tested by running locally" can't cover a Terraform deploy of the review app. Say how it was verified, for example with a plan output or the review app run.
Tests
No automated tests are added. For Terraform and package-version changes that is understandable.
Because of the new DfeAnalytics.EFCore reference and the version bumps, the project's rules call for running unit, integration and E2E before calling it done.
The existing AnalyticsRegistrationTests and DfeAnalyticsServiceTests should be re-run against 0.6.4.
Deployments
|
39a3745 to
0b4f09b
Compare
|
Hi Jordan, Thanks for the context, and no need to apologise. My comments came from reviewing the diff without the background you've given me now. A few were The PR to your own branch: that wasn't meant as a block. It got picked up because it was awaiting review. It's fine that you've deleted it. Draft: could you set #709 to draft until it's ready? Then it won't get reviewed before you want it to. I'll take a proper look once it's ready. Secrets / "only in review": that one was my wording, not your code. Enabling it only for review is right for this PR. I was only checking that the pg_airbyte: not a question. I'd noted it's already on in QA and prod, so this PR only adds the Airbyte side. The write-ahead logging explanation makes Tests: all fine now. The review app's E2E run passed (376 passed, 0 failed), and the deploy working answers my worry about the Terraform plan. The .NET changes: that makes sense, thanks. Could you add a line to the description saying they're James's dfe-analytics bump to 0.6.4, needed for the When you take it out of draft, these are the things I'd still like:
Shout if you want to go through any of it on a call. |
0d81ba1 to
0c878be
Compare
0c878be to
e55658b
Compare
E2E tests failed@ColeJordan-mobilise this is your pull request: please look at what failed and fix it, or say here why it is not the change. 375 passed, 1 failed, 4 skipped in 16 min 38 s Commit Failed tests (1)
|
Context
This PR adds the application and infrastructure changes needed to deploy and test Airbyte in a review app. Airbyte copies the Postgres database to BigQuery.
It is a draft while the Airbyte setup is tested with the infrastructure team. It is not ready to merge.
Changes proposed in this pull request
Terraform
airbytehq/airbyteprovider (pinned to 0.10.0).infrastructure_secrets:AIRBYTE-WORKSPACE-ID,AIRBYTE-CLIENT-ID,AIRBYTE-CLIENT-SECRET,AIRBYTE-REPLICATION-PASSWORD,AIRBYTE-BQ-SA. The infra team creates these by hand, and plan fails if they are missing while Airbyte is enabled.pg_airbyte_enabledturns on the Postgres write-ahead logging that replication needs. It is already on in QA and production..NET (James's dfe-analytics bump)
DfeAnalytics.CoreandDfeAnalytics.AspNetCorefrom 0.6.2 to 0.6.4.DfeAnalytics.EFCore0.6.4 to the Persistence project and setsDfeAnalyticsDbContexttoPortalDbContextinDirectory.Build.props.is_dotnet_application = true) and uses these to read our DbContext. Our own code does not use the package yet.These changes first came in PR #672. That branch had merge conflicts, so they were moved onto a fresh branch here.
Guidance to review
How it was checked
Link to Trello card
https://trello.com/c/KrX6D2se/2997-enable-airbyte-in-service-cypmd
Checklist