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

Add enabledOperators parameter for workspace name unique check #306

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

Hailong-am
Copy link
Collaborator

Description

Add enabledOperators parameter for workspace name unique check. The default value for this flag is ALL means all operators are supported.

For example we have workspace named test-workspace and now we create a new workspace named test test-workspace that will match existing test-workspace by using simple query string and leads name unique check failed.

GET .kibana/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "type": {
              "value": "workspace"
            }
          }
        },
        {
          "simple_query_string": {
            "query": "test test-workspace", // this means match name by test or test-workspace
            "fields": [
              "workspace.name"
            ],
            "flags": "ALL"
          }
        }
      ]
    }
  }
}
# test-workspace will return

Issues Resolved

Screenshot

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 53.55%. Comparing base (0f34d69) to head (bb9076a).
Report is 9 commits behind head on workspace-pr-integr.

Files Patch % Lines
...ved_objects/service/lib/search_dsl/query_params.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           workspace-pr-integr     #306       +/-   ##
========================================================
+ Coverage                35.17%   53.55%   +18.37%     
========================================================
  Files                     1885     2236      +351     
  Lines                    36421    43517     +7096     
  Branches                  6672     8091     +1419     
========================================================
+ Hits                     12810    23304    +10494     
+ Misses                   22761    18566     -4195     
- Partials                   850     1647      +797     
Flag Coverage Δ
_3 43.57% <0.00%> (?)
_4 35.16% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SuZhou-Joe
Copy link
Collaborator

Overall looks good to me. But can we add a integration_test for this case? You can leverage the workspace CRUD integration test file to add the enabledOperators related test cases.

@Hailong-am
Copy link
Collaborator Author

Overall looks good to me. But can we add a integration_test for this case? You can leverage the workspace CRUD integration test file to add the enabledOperators related test cases.

sure, will add a test for it

Copy link
Collaborator

@SuZhou-Joe SuZhou-Joe left a comment

Choose a reason for hiding this comment

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

LGTM.

@Hailong-am Hailong-am merged commit da95876 into ruanyl:workspace-pr-integr Apr 15, 2024
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants