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

chore: Drop dependency on pointy #1953

Merged
merged 1 commit into from
Feb 16, 2024
Merged

chore: Drop dependency on pointy #1953

merged 1 commit into from
Feb 16, 2024

Conversation

gssbzn
Copy link
Collaborator

@gssbzn gssbzn commented Feb 16, 2024

Description

Drop dependency on pointy and use conversion.Pointer instead

@gssbzn gssbzn requested a review from a team as a code owner February 16, 2024 12:11
@gssbzn gssbzn changed the title task: remove dependency on pointy chore: remove dependency on pointy Feb 16, 2024
@gssbzn gssbzn changed the title chore: remove dependency on pointy chore: drop dependency on pointy Feb 16, 2024
@gssbzn gssbzn changed the title chore: drop dependency on pointy chore: Drop dependency on pointy Feb 16, 2024
Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM

SampleSizeBIConnector: pointy.Int64(110),
TransactionLifetimeLimitSeconds: pointy.Int64(300),
NoTableScan: conversion.Pointer(false),
OplogSizeMB: conversion.Pointer[int64](1000),
Copy link
Member

Choose a reason for hiding this comment

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

does it fail if [int64] is not specified?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, OplogSizeMB is int64 and the literal 1000 is int so you need to provide the cast

CopyProtectionEnabled: conversion.Pointer(d.Get("copy_protection_enabled").(bool)),
EncryptionAtRestEnabled: conversion.Pointer(d.Get("encryption_at_rest_enabled").(bool)),
PitEnabled: conversion.Pointer(d.Get("pit_enabled").(bool)),
RestoreWindowDays: conversion.Pointer(cast.ToInt(d.Get("restore_window_days"))),
Copy link
Member

Choose a reason for hiding this comment

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

not sure why it's not similar to other places, e.g. d.Get("restore_window_days").(int)

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'm just replacing the pointer, there seem sto be a combination of using cast and .int all over

ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
Steps: []resource.TestStep{
{
Config: testAccMongoDBAtlasProjectsConfigWithDS(projectName, orgID,
[]*admin.TeamRole{
{
TeamId: conversion.StringPtr(acc.GetProjectTeamsIdsWithPos(0)),
TeamId: conversion.StringPtr(acc.GetProjectTeamsIDsWithPos(0)),
Copy link
Member

Choose a reason for hiding this comment

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

do you know why Ids didn't fail the linter before?

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 have a newer linter locally which picks these now, it was a small drive by I didn't bother in trying to switch to your version of the linter

Copy link
Member

@lantoli lantoli left a comment

Choose a reason for hiding this comment

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

thanks, this is great!

@gssbzn gssbzn merged commit 95098f6 into master Feb 16, 2024
47 of 50 checks passed
@gssbzn gssbzn deleted the drop-pinty branch February 16, 2024 14:10
lantoli added a commit that referenced this pull request Feb 16, 2024
* master:
  fix: Fixes timeout and removes deletion logic on update failure for mongodbatlas_search_index resource (#1950)
  task: remove dependency on pointy (#1953)
  fix: Converts snapshot_id field from required to optional. (#1924)

# Conflicts:
#	internal/service/cluster/resource_cluster.go
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