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: Improves error handling messages in advanced cluster tpf #2914

Merged
merged 5 commits into from
Dec 23, 2024

Conversation

EspenAlbert
Copy link
Collaborator

@EspenAlbert EspenAlbert commented Dec 19, 2024

Description

Improves error handling messages in advanced cluster tpf
Error diagnostics principle:

  • Summary should be a real sentence, static, and unique string.
  • Detail can be more sentences with parameters.

Alo changes:

  • Include the attribute name for deprecated fields

Link to any related issue(s): CLOUDP-288298

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

Base automatically changed from CLOUDP-287995_replication_spec_match_fix to master December 20, 2024 10:42
@EspenAlbert EspenAlbert force-pushed the CLOUDP-288298_implementation_docs branch from c55d4ad to fa993d2 Compare December 20, 2024 10:55
@EspenAlbert EspenAlbert marked this pull request as ready for review December 20, 2024 15:04
@EspenAlbert EspenAlbert requested a review from a team as a code owner December 20, 2024 15:04
@EspenAlbert
Copy link
Collaborator Author

Only TestAccClusterAdvancedCluster_withTags failing (cloud dev 3h timeout)

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

internal/service/advancedclustertpf/data_source.go Outdated Show resolved Hide resolved
const (
errorReadDatasource = "Error reading advanced cluster datasource"
errorReadDatasourceAsymmetric = "Error reading advanced cluster datasource"
errorReadDatasourceAsymmetricDetail = "Cluster name %s. Please add `use_replication_spec_per_shard = true` to your data source configuration to enable asymmetric shard support. Refer to documentation for more details."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you provide a link to the doc as part of the error message? We do this in the CLI. You should ask the doc team for a dochub link if the documentation is in the MDB website

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. Added the link to our migration guide that has more details in 1c35df4

@@ -14,6 +14,12 @@ import (
var _ datasource.DataSource = &ds{}
var _ datasource.DataSourceWithConfigure = &ds{}

const (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these principles documented somewhere in the repo?

Error diagnostics principle:
Summary should be a real sentence, static, and unique string.
Detail can be more sentences with parameters.
Include the attribute name for deprecated fields

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the comments 😄
Added this to our techincal discussion.

@EspenAlbert EspenAlbert merged commit a3f7e43 into master Dec 23, 2024
41 checks passed
@EspenAlbert EspenAlbert deleted the CLOUDP-288298_implementation_docs branch December 23, 2024 13:30
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.

2 participants