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

mgr/dashboard: make application field for pool creation mandatory #51566

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

avanthakkar
Copy link
Contributor

@avanthakkar avanthakkar commented May 18, 2023

Fixes: https://tracker.ceph.com/issues/61238

Before
Screenshot from 2023-05-18 18-06-15

After:
Screenshot from 2023-05-19 15-10-21

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@avanthakkar avanthakkar requested a review from a team as a code owner May 18, 2023 12:15
@avanthakkar avanthakkar requested review from pereman2 and aaSharma14 and removed request for a team May 18, 2023 12:15
Copy link
Contributor

@pereman2 pereman2 left a comment

Choose a reason for hiding this comment

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

Didn't work. It created the pool after saying it was required.

screen-capture.8.webm

@avanthakkar
Copy link
Contributor Author

Didn't work. It created the pool after saying it was required.
screen-capture.8.webm

Just fixed the submit if no application selected. PTAL!

@avanthakkar avanthakkar requested a review from pereman2 May 18, 2023 12:33
Copy link
Contributor

@Pegonzal Pegonzal left a comment

Choose a reason for hiding this comment

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

Just a NIT

The: This field is required! text only shows if all other fields have been filled

image

image

@avanthakkar
Copy link
Contributor Author

jenkins test make check

Copy link
Member

@nizamial09 nizamial09 left a comment

Choose a reason for hiding this comment

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

Probably it should be better to add a helper here saying that a pool cannot be used without associating with an application before

@avanthakkar
Copy link
Contributor Author

Probably it should be better to add a helper here saying that a pool cannot be used without associating with an application before

And added a helper for application fields.

@avanthakkar
Copy link
Contributor Author

jenkins test make check

@avanthakkar
Copy link
Contributor Author

jenkins test dashboard

@nizamial09
Copy link
Member

make-check failure

● PoolFormComponent › submit - create › erasure coded pool › minimum requirements without ECP to create ec pool

    expect(spy).toHaveBeenCalledWith(...expected)

    Expected: {"pg_autoscale_mode": "off", "pg_num": 4, "pool": "minECPool", "pool_type": "erasure"}

    Number of calls: 0

      82 |     spyOn(taskWrapper, 'wrapTaskAroundCall').and.callThrough();
      83 |     component.submit();
    > 84 |     expect(poolService[poolServiceMethod]).toHaveBeenCalledWith(pool);
         |                                            ^
      85 |     expect(taskWrapper.wrapTaskAroundCall).toHaveBeenCalledWith({
      86 |       task: {
      87 |         name: taskName,

      at expectValidSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:84:44)
      at src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1108:9
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:409:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3830:43)
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:408:56)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:169:47)
      at Object.wrappedFunc (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4330:34)

  ● PoolFormComponent › submit - create › erasure coded pool › creates ec pool with erasure coded profile

    expect(spy).toHaveBeenCalledWith(...expected)

    - Expected
    + Received

    @@ -1,6 +1,10 @@
      Object {
    +   "application_metadata": Array [
    +     "cephfs",
    +     "rgw",
    +   ],
        "erasure_code_profile": "ecpMinimalMock",
        "pg_autoscale_mode": "off",
        "pg_num": 4,
        "pool": "ecPool",
        "pool_type": "erasure",,

    Number of calls: 1

      82 |     spyOn(taskWrapper, 'wrapTaskAroundCall').and.callThrough();
      83 |     component.submit();
    > 84 |     expect(poolService[poolServiceMethod]).toHaveBeenCalledWith(pool);
         |                                            ^
      85 |     expect(taskWrapper.wrapTaskAroundCall).toHaveBeenCalledWith({
      86 |       task: {
      87 |         name: taskName,

      at expectValidSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:84:44)
      at expectEcSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1077:9)
      at src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1122:9
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:409:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3830:43)
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:408:56)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:169:47)
      at Object.wrappedFunc (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4330:34)

  ● PoolFormComponent › submit - create › erasure coded pool › creates ec pool with ec_overwrite flag

    expect(spy).toHaveBeenCalledWith(...expected)

    - Expected
    + Received

    @@ -1,6 +1,10 @@
      Object {
    +   "application_metadata": Array [
    +     "cephfs",
    +     "rgw",
    +   ],
        "erasure_code_profile": "ecp1",
        "flags": Array [
          "ec_overwrites",
        ],
        "pg_autoscale_mode": "off",,

    Number of calls: 1

      82 |     spyOn(taskWrapper, 'wrapTaskAroundCall').and.callThrough();
      83 |     component.submit();
    > 84 |     expect(poolService[poolServiceMethod]).toHaveBeenCalledWith(pool);
         |                                            ^
      85 |     expect(taskWrapper.wrapTaskAroundCall).toHaveBeenCalledWith({
      86 |       task: {
      87 |         name: taskName,

      at expectValidSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:84:44)
      at expectEcSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1077:9)
      at src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1132:9
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:409:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3830:43)
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:408:56)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:169:47)
      at Object.wrappedFunc (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4330:34)

@nizamial09
Copy link
Member

@avanthakkar ping^

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Dec 16, 2023
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this Jan 15, 2024
@cloudbehl cloudbehl reopened this May 9, 2024
@cloudbehl cloudbehl removed the stale label May 9, 2024
@avanthakkar
Copy link
Contributor Author

make-check failure

● PoolFormComponent › submit - create › erasure coded pool › minimum requirements without ECP to create ec pool

    expect(spy).toHaveBeenCalledWith(...expected)

    Expected: {"pg_autoscale_mode": "off", "pg_num": 4, "pool": "minECPool", "pool_type": "erasure"}

    Number of calls: 0

      82 |     spyOn(taskWrapper, 'wrapTaskAroundCall').and.callThrough();
      83 |     component.submit();
    > 84 |     expect(poolService[poolServiceMethod]).toHaveBeenCalledWith(pool);
         |                                            ^
      85 |     expect(taskWrapper.wrapTaskAroundCall).toHaveBeenCalledWith({
      86 |       task: {
      87 |         name: taskName,

      at expectValidSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:84:44)
      at src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1108:9
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:409:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3830:43)
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:408:56)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:169:47)
      at Object.wrappedFunc (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4330:34)

  ● PoolFormComponent › submit - create › erasure coded pool › creates ec pool with erasure coded profile

    expect(spy).toHaveBeenCalledWith(...expected)

    - Expected
    + Received

    @@ -1,6 +1,10 @@
      Object {
    +   "application_metadata": Array [
    +     "cephfs",
    +     "rgw",
    +   ],
        "erasure_code_profile": "ecpMinimalMock",
        "pg_autoscale_mode": "off",
        "pg_num": 4,
        "pool": "ecPool",
        "pool_type": "erasure",,

    Number of calls: 1

      82 |     spyOn(taskWrapper, 'wrapTaskAroundCall').and.callThrough();
      83 |     component.submit();
    > 84 |     expect(poolService[poolServiceMethod]).toHaveBeenCalledWith(pool);
         |                                            ^
      85 |     expect(taskWrapper.wrapTaskAroundCall).toHaveBeenCalledWith({
      86 |       task: {
      87 |         name: taskName,

      at expectValidSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:84:44)
      at expectEcSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1077:9)
      at src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1122:9
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:409:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3830:43)
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:408:56)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:169:47)
      at Object.wrappedFunc (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4330:34)

  ● PoolFormComponent › submit - create › erasure coded pool › creates ec pool with ec_overwrite flag

    expect(spy).toHaveBeenCalledWith(...expected)

    - Expected
    + Received

    @@ -1,6 +1,10 @@
      Object {
    +   "application_metadata": Array [
    +     "cephfs",
    +     "rgw",
    +   ],
        "erasure_code_profile": "ecp1",
        "flags": Array [
          "ec_overwrites",
        ],
        "pg_autoscale_mode": "off",,

    Number of calls: 1

      82 |     spyOn(taskWrapper, 'wrapTaskAroundCall').and.callThrough();
      83 |     component.submit();
    > 84 |     expect(poolService[poolServiceMethod]).toHaveBeenCalledWith(pool);
         |                                            ^
      85 |     expect(taskWrapper.wrapTaskAroundCall).toHaveBeenCalledWith({
      86 |       task: {
      87 |         name: taskName,

      at expectValidSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:84:44)
      at expectEcSubmit (src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1077:9)
      at src/app/ceph/pool/pool-form/pool-form.component.spec.ts:1132:9
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:409:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3830:43)
      at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:408:56)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:169:47)
      at Object.wrappedFunc (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4330:34)

Fixed unit tests, passing locally!

@avanthakkar
Copy link
Contributor Author

jenkins retest this please

<label class="cd-col-form-label required"
for="applications">
<ng-container i18n>Applications</ng-container>
<cd-helper>
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use after the input tag here as well.

<cd-help-text>
<span i18n>The number of days that you want to specify for the default retention period that will be applied to new objects placed in this bucket.</span>
</cd-help-text>

We need to gradually move to this style, for all new things added and rest will be taken care by carbon

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've already addressed this here #51591. So once that's merged I can simple rebase this PR. Marking this PR as DNM for now and after #51591

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@afreen23 I've merged #51591 and rebased this PR, can you review it again?

@avanthakkar
Copy link
Contributor Author

After #51591

@avanthakkar
Copy link
Contributor Author

jenkins test make check

@avanthakkar
Copy link
Contributor Author

jenkins test dashboard

@avanthakkar
Copy link
Contributor Author

jenkins test dashboard cephadm

@avanthakkar
Copy link
Contributor Author

jenkins test dashboard

@avanthakkar
Copy link
Contributor Author

jenkins test dashboard cephadm

@avanthakkar
Copy link
Contributor Author

jenkins test make check arm64

@avanthakkar
Copy link
Contributor Author

jenkins test dashboard

Copy link

@sunilangadi2 sunilangadi2 left a comment

Choose a reason for hiding this comment

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

@avanthakkar application is not mandatory for pool creation,
why are we making it as This field is required!?

@avanthakkar
Copy link
Contributor Author

avanthakkar commented May 29, 2024

@avanthakkar application is not mandatory for pool creation, why are we making it as This field is required!?

Well you have to add some application anyways after creation else it'll show health_warn

Copy link

@sunilangadi2 sunilangadi2 left a comment

Choose a reason for hiding this comment

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

yes it make sense from CLI as well

HEALTH_WARN 1 pool(s) do not have an application enabled; 4 pool(s) have non-power-of-two pg_num
[WRN] POOL_APP_NOT_ENABLED: 1 pool(s) do not have an application enabled
    application not enabled on pool 'rep_pool_mGnGGtgZwA'
    use 'ceph osd pool application enable <pool-name> <app-name>', where <app-name> is 'cephfs', 'rbd', 'rgw', or freeform for custom applications.```

@@ -189,6 +194,9 @@
title="Pools should be associated with an application tag"
class="{{icons.warning}} icon-warning-color">
</i>
<span class="invalid-feedback"
*ngIf="!isApplicationsSelected"
i18n>This field is required!</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
i18n>This field is required!</span>
i18n>Application selection is required!</span>

@cloudbehl cloudbehl removed the DNM label May 29, 2024
@cloudbehl
Copy link
Contributor

cloudbehl commented May 30, 2024

The validation sticks around even after selecting the application. Can you make sure once user selects the application this goes away.

Screencast.from.2024-05-30.11-17-14.webm

Copy link

github-actions bot commented Jun 7, 2024

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in progress
7 participants