Skip to content

chore: add orgId and projectid #159

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

Merged
merged 19 commits into from
Apr 29, 2025
Merged

chore: add orgId and projectid #159

merged 19 commits into from
Apr 29, 2025

Conversation

blva
Copy link
Collaborator

@blva blva commented Apr 29, 2025

  • infers the values from args
  • if using a mongodb tool, checks if it's connected to an atlas cluster

@blva blva force-pushed the telemetry-updates branch from dac1b2d to ab608c8 Compare April 29, 2025 11:45
@blva blva changed the title chore: minor improvements chore: add orgId and projectid Apr 29, 2025
if ("orgId" in data && typeof data.orgId === "string" && data.orgId.trim() !== "") {
toolMetadata.orgId = data.orgId;
}
} catch (error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

[q] when might catch happen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hopefully never I just don't want telemetry to cause any issues but can remove

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see no method that might have side effects, which line might throw? perhaps argsShape.safeParse?

perhaps the try catch is better suited for emitToolEvent, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

can be! moving

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's just that we could still emit if this goes wrong, but no strong opinions

@blva blva marked this pull request as ready for review April 29, 2025 13:22
@blva blva requested review from nirinchev, gagik and a team as code owners April 29, 2025 13:22
@blva blva requested review from gagik and fmenezes April 29, 2025 14:13
blva and others added 3 commits April 29, 2025 15:21
Co-authored-by: Gagik Amaryan <me@gagik.co>
}));

beforeEach(() => {
integration.mcpServer().userConfig.connectionString = mdbIntegration.connectionString();
integration.mcpServer().userConfig.telemetry = "disabled"; // Ensure telemetry stays disabled
Copy link
Collaborator

Choose a reason for hiding this comment

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

[q] do we need to do this for atlas as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

if we are changing this value on the fly, it would be better for the test that changes it to change it back.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've been testing this, need to change it slightly, will udpate

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated, and atlas is not emitting, only mdbtools were missing

@blva blva requested a review from fmenezes April 29, 2025 15:07

beforeAll(async () => {
// GET DO_NOT_TRACK value
oldDoNotTrackValue = process.env.DO_NOT_TRACK;
process.env.DO_NOT_TRACK = "1";
const userConfig = getUserConfig();
Copy link
Collaborator

@fmenezes fmenezes Apr 29, 2025

Choose a reason for hiding this comment

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

Instead of keeping track of DO_NOT_TRACK, why not?

Suggested change
const userConfig = getUserConfig();
const userConfig = {
...getUserConfig(),
telemetry: "disabled"
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually, let me try to sort our default test config everywhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I had this somewhere too, but I can add it if 3eee38c doesn't work

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this won't work too cause telemetry imports config so it's not injected, only env variables would work or we can refactor

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll refactor a bit

@blva blva requested a review from fmenezes April 29, 2025 15:42
@blva blva merged commit aaf96d1 into main Apr 29, 2025
16 checks passed
@blva blva deleted the telemetry-updates branch April 29, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants