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

731 multiple support queues #67

Merged
merged 28 commits into from
May 24, 2022
Merged

731 multiple support queues #67

merged 28 commits into from
May 24, 2022

Conversation

abujeda
Copy link
Contributor

@abujeda abujeda commented May 23, 2022

No description provided.

})
})

it('Should create support ticket', () => {
cy.task('log', `Support Ticket creationEnabled=${supportTicket.creationEnabled}`)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be nice to log the queue name as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done. 5518434

@priority = config[:priority]

if !@queue || !@priority
raise ArgumentError, "queue_name and priority are required options for RT service"
if !@queues || !@priority
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be check for empty queues too?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done. 5518434

@@ -30,8 +31,9 @@ def create
end

rts = RequestTrackerService.new ::Configuration.request_tracker_config
rts.selected_queue = queue
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that the queue name can be overriden with a request parameter, should the support_ticket object carry this value? The overriden value can be set into support_ticket in create_support_ticket function.

Copy link
Contributor

Choose a reason for hiding this comment

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

I had initially thought that the queue selection would make sense as part of the SupportTicket object, but I moved it to the RequestTrackerService object when I saw that only the latter has the information from the client configuration file, which is necessary in order to validate the queue selection. This way, the queue selection can be validated at the time of assignment. If the queue selection is part of the SupportTicket object, then it cannot be validated until the SupportTicket object is passed to the RequestTrackerService.create_ticket method.

Do you think that it is ok to wait to validate the queue selection until this late in the execution flow?

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 see. For me it is ok to do input validation in the create_ticket method.

The only thing I am wary of is adding selected_queue as a class field. This makes the service a transient object (although this is the way we are using it anyway)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. I was concerned it might be a problem if the SupportTicket object validates some of its instance variables at assignment and others are not validated until their use, but if you are ok with this then I will move the variable there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done. 1653517

@@ -14,5 +14,6 @@
{"token": "Stata", "name": "Stata"},
{"token": "SAS", "name": "SAS"},
{"token": "Matlab", "name": "Matlab"}
]
],
"support_ticket": {"creationEnabled": true, "queue": "Internal:Logging"}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

support_ticket default values can be set into https://github.com/hmdc/sid2/blob/canary/automated-testing/cypress/support/base.js#L33 for simplicity

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but since these are site-specific values, I prefer that they go in configuration files.

@@ -15,5 +15,5 @@
{"token": "SAS", "name": "SAS"},
{"token": "Matlab", "name": "Matlab"}
],
"support_ticket": {"creationEnabled": false}
"support_ticket": {"creationEnabled": true, "queue": "Internal:Logging"}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

creation enabled in remote-dev will require the production rt_config file to be added manually to the dashboard folder before deploying.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is documented in detail here, which is referred to here.

user: "root"
pass: "password"
queues:
- "General"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need to add the "Alternate" queue in the local rt_config.yml?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, the RT client configuration for local dev only needs to specify one queue in order to be functional. I only included an additional (nonexistent) queue in the RT client configuration for automated-testing so that the test suite could test what happens when a configuration file is loaded that contains multiple configured queues.

@abujeda abujeda merged commit 13b67c2 into canary May 24, 2022
abujeda added a commit that referenced this pull request May 24, 2022
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