Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(NODE-6728): test FLE on Alpine linux #4417

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Feb 13, 2025

Description

What is changing?

A new variant that runs FLE tests in a docker container on Alpine linux has been added.

Is there new documentation needed for these changes?

What is the motivation for this change?

Release Highlight

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@baileympearson baileympearson force-pushed the alpine-tests branch 2 times, most recently from e1b4a9e to dae0573 Compare February 13, 2025 18:10
@@ -94,7 +94,6 @@
"express": "^4.21.2",
"gcp-metadata": "^5.3.0",
"js-yaml": "^4.1.0",
"kerberos": "^2.2.1",
"mocha": "^10.8.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kerberos fails to install on alpine because we don't support it.

Copy link
Member

Choose a reason for hiding this comment

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

This was explicitly added in #4411 . I guess it wasn't needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like I forgot to update the lockfile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the force push - I had to rebase with main. But fixed.

if (process.env.MONGODB_API_VERSION) {
options.serverApi = process.env.MONGODB_API_VERSION as MongoClientOptions['serverApi'];
}
function makeClient(
Copy link
Contributor Author

@baileympearson baileympearson Feb 13, 2025

Choose a reason for hiding this comment

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

The capturing mongoclient causes issues because clients are not instantiated with configuration.newClient().

const AWS_REGION = process.env.AWS_REGION;
const AWS_CMK_ID = process.env.AWS_CMK_ID;
const AWS_REGION = 'us-east-1';
const AWS_CMK_ID = 'dummy-cmk-id';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These values come from our evergreen project, not secrets manager. These tests don't actually need valid secrets - these dummy values suffice.

@@ -186,7 +188,7 @@ const testConfigBeforeHook = async function () {
adl: this.configuration.buildInfo.dataLake
? this.configuration.buildInfo.dataLake.version
: false,
kerberos: process.env.KRB5_PRINCIPAL != null,
kerberos: process.env.PRINCIPAL != null,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was no longer accurate after migrating kerberos to secrets manager.

@baileympearson baileympearson changed the title Alpine tests ci(NODE-6728): test FLE on Alpine linux Feb 13, 2025

const kmsProviders = {
aws: { accessKeyId: AWS_ACCESS_KEY_ID, secretAccessKey: AWS_SECRET_ACCESS_KEY }
local: { key: Buffer.alloc(96) }
Copy link
Contributor Author

@baileympearson baileympearson Feb 14, 2025

Choose a reason for hiding this comment

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

These tests still rely on expansions because these were node-specific unit tests. This fails without additional environment setup in the docker container because the secrets aren't available in secrets-export.sh.

I chose to rewrite these tests to be environment-independent because they're testing keyAltNames functionality, not AWS KMS integration.

@baileympearson baileympearson marked this pull request as ready for review February 14, 2025 19:38
@baileympearson baileympearson requested a review from a team as a code owner February 14, 2025 19:38
@durran durran self-assigned this Feb 18, 2025
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants