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

CLOUDP-221979: Atlas search index #1430

Merged
merged 38 commits into from
May 3, 2024

Conversation

igor-karpukhin
Copy link
Collaborator

All Submissions:

This PR adds AtlasSearch feature to the operator

  • Have you signed our CLA?
  • Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if there is one).
  • Update docs/release-notes/release-notes.md if your changes should be included in the release notes for the next release.

@josvazg
Copy link
Collaborator

josvazg commented Mar 8, 2024

I think, once the typing is completed, we could merge this as the first part of the change. Next we could review how we handle the CRDs without distractions on the type definitions.

IMHO we could add PRs incrementally even for unfinished work, so far it does not break the build and incomplete code does not affect the end users, so it is invisible to them. For us the benefit is smaller and more focused PRs.

@igor-karpukhin igor-karpukhin force-pushed the CLOUDP-221979/atlas-search-index branch from b0ad7ad to f1b4076 Compare April 8, 2024 08:17
@igor-karpukhin igor-karpukhin force-pushed the CLOUDP-221979/atlas-search-index branch from 71ab979 to 114de06 Compare April 18, 2024 08:36
@igor-karpukhin igor-karpukhin force-pushed the CLOUDP-221979/atlas-search-index branch 3 times, most recently from 615bdb1 to f787086 Compare April 30, 2024 07:58
@igor-karpukhin igor-karpukhin added the cloud-tests Run expensive Cloud Tests: Integration & E2E label May 2, 2024
Copy link
Contributor

github-actions bot commented May 2, 2024

@igor-karpukhin igor-karpukhin marked this pull request as ready for review May 2, 2024 14:01
@s-urbaniak
Copy link
Collaborator

side note @igor-karpukhin: I am generally fine with addressing the missing unit tests next week, iff e2e yields green here so we can have at least one monday-midnight e2e and matrix test signal next week.

if !verifyAllIndexesNamesAreUnique(sr.deployment.Spec.DeploymentSpec.SearchIndexes) {
return sr.terminate(status.SearchIndexesNamesAreNotUnique, fmt.Errorf("every index 'Name' must be unique"))
}
sr.ctx.Log.Debug("all indexes names are unique")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this intended for the final version or just a trace?

}

func (r *AtlasSearchIndexConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := r.Log.With("atlassearchindexconfig", req.NamespacedName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not camel cased?

Suggested change
log := r.Log.With("atlassearchindexconfig", req.NamespacedName)
log := r.Log.With("AtlasSearchIndexConfig", req.NamespacedName)

The logger was created with that:

Log:                         logger.Named("controllers").Named("AtlasSearchIndexConfig").Sugar(),

In fact, I am confused why we need both definitions. Seems that log libe above might be repetitive or stuttering, with or without camel case.

go.mod Outdated Show resolved Hide resolved
config/manager/kustomization.yaml Outdated Show resolved Hide resolved
pkg/controller/atlasdeployment/search_index_calls.go Outdated Show resolved Hide resolved

// NewSearchIndexFromAtlas returns internal representation of the SearchIndex converted from Atlas
// internals. It can return an error in case some fields are not valid JSON.
func NewSearchIndexFromAtlas(index admin.ClusterSearchIndex) (*SearchIndex, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This method has little unit test coverage, please increase as it is central. We just found a bug in here as well.

@s-urbaniak
Copy link
Collaborator

TLDR from the discussion with @josvazg and @helderjs: @igor-karpukhin please address comments in a follow-up PR. We will merge this one as soon as it goes green on e2e. It already passes green locally on my machine.

@igor-karpukhin igor-karpukhin merged commit c0a4cdf into main May 3, 2024
51 checks passed
@helderjs helderjs deleted the CLOUDP-221979/atlas-search-index branch August 6, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud-tests Run expensive Cloud Tests: Integration & E2E
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants