Skip to content

enhance group events DEX message for additional fields such as scope description#86

Closed
bpow wants to merge 9 commits intomainfrom
reconciliation_gold
Closed

enhance group events DEX message for additional fields such as scope description#86
bpow wants to merge 9 commits intomainfrom
reconciliation_gold

Conversation

@bpow
Copy link
Copy Markdown
Collaborator

@bpow bpow commented Nov 5, 2024

Opening pull request as @tmbattey-2021 indicated this is ready for review.

@tmbattey-2021
Copy link
Copy Markdown
Contributor

Configs.json shouldn't be part of this change request. It's related to the roles change.

@bpow bpow force-pushed the reconciliation_gold branch from bf608b2 to aa3dbff Compare November 5, 2024 19:06
@bpow
Copy link
Copy Markdown
Collaborator Author

bpow commented Nov 5, 2024

Configs.json shouldn't be part of this change request. It's related to the roles change.

I'm guessing that is probably true for groups.php as well?

Since I have needed to rebase to current main, anyway, I will amend this commit to not include configs.json and groups.php.

@bpow bpow force-pushed the reconciliation_gold branch from aa3dbff to d5846e8 Compare November 5, 2024 19:17
@bpow
Copy link
Copy Markdown
Collaborator Author

bpow commented Nov 5, 2024

Modified commit to just include the files relevant to this change. Older version of the commit is in branch reconciliation_gold_with_extraneous, but that branch should be removed, @tmbattey-2021 when you can be sure you have those changes tracked elsewhere if needed.

return [
'expert_panel' => array_merge([
'id' => $this->group->uuid,
'long_name' => $this->group->name,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

As we discussed earlier today, it may be helpful to review the call. I thought the website team was OK with receiving things labelled as either long_name or name, as long as we are consistent, and there are many other messages where the group name is sent as name. Personally, I lean towards name since that's also what it is called in the underlying db model.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, I understood from the call that other messages use name. The code is in good enough shape to send to gpm demo and revise later. There was only one example of name given on the call.

// Conditionally add vcep fields below if type is 'vcep'
$this->group->fullType->name === 'vcep' ? ['clinvar_id' => null] : [],
$this->group->fullType->name === 'vcep' ? ['clinvar_url' => null] : [],
$this->group->fullType->name === 'vcep' ? ['cspec_url' => $this->group->expertPanel->affiliation_id] : [],
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is just an affiliation id, not a URL, so the field should probably have a different name. I thought we had talked about the website team generating this url from the affiliation ID, right?


// Only process the event if the status is 2 or 5
if (!in_array($this->group->group_status_id, [2, 3, 4, 5])) {
return;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Does this even do anything different? It looks to just be returning from the constructor "early", but it would also return right after this statement.

@tmbattey-2021
Copy link
Copy Markdown
Contributor

tmbattey-2021 commented Nov 6, 2024 via email

@bpow
Copy link
Copy Markdown
Collaborator Author

bpow commented Nov 6, 2024

I added the filter by status, as the original requirement was to send active and the other. It works. I’ll remove the magic numbers. What is your suggestion for a better filter location?

Did you test that this actually filters by status as you intended, because I don't think that placing a guard in the constructor like this (with just a return) would do so.

There are several places I've mentioned this that may be relevant:

  1. In email earlier yesterday afternoon, where I suggested that a guard like this should probably go in something like a "shouldPublish" function
  2. In comment last month in changes to reconcile current gpm message to website data #70 where I referenced shouldPublish as a function that's part of PublishableEvent used to determine whether notification of an event goes to the dx (in that context regarding the publishing of non-vcep, non-gcep events)
  3. In CGSP-505 comment to make sure you had seen the above comment in PR#70

Although as mentioned in another CGSP-505 comment, it doesn't look like GroupEvent ever implements PublishableEvent, so maybe something is handled differently.

This should definitely be a topic for additional documentation when you are able to identify the process (and again, I have suggested that the entirety of which messages are published at which events should be better documented).

if (!in_array($this->group->group_status_id, [2, 3, 4, 5])) {
return;
}
if ($this->group->group_status_id != config('groups.statuses.applying.id')) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You need to test locally to see if having this here really prevents the message from being sent when a group is in status of applying. I do not think it does, so this is blocking merge into main.

'scope_description' => $this->group->expertPanel->scope_description,
],
// Conditionally add vcep fields below if type is 'vcep'
$this->group->fullType->name === 'vcep' ? ['clinvar_id' => null] : [],
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am hesitant to merge to main while these vcep fields (clinvar_id and clinvar_url) remain null as placeholders.

@tmbattey-2021
Copy link
Copy Markdown
Contributor

tmbattey-2021 commented Nov 19, 2024 via email

@bpow bpow force-pushed the reconciliation_gold branch from 6641429 to f465254 Compare November 20, 2024 15:34
tmbattey-2021 and others added 9 commits December 17, 2024 11:20
…description

original commit was modified by bpow to remove extraneous file changes
in configs.json and groups.php
This should not been needed since the GroupEvent is in the file's
namespace. Furthermore, it had been added to the previous commit
spuriously (not related to the other parts of the commit.

This should probably be a "fixup" to prior commit before eventual
merge to main, but keeping in history for now for tracking purposes
changing this to 2.0.0 should be one of the last things we do
before moving to production as protection against the possibility
of accidentally publishing messages with a different format under
the eventual 2.0.0 version number
* not needed for status since group_status is specified as NOT NULL and
  foreign key, so should always be present. I'd rather see an error than
  have it silently produce an empty value
* use null-safe dereference rather than optional for parent_group. This
  is considered by many to be easier to read, and as it was written (with
  "->name" outside of the parentheses, I don't think it would have worked
  for all of the null-possible cases as it was written, anyway (if there
  was no parent group, then `optional($this->group->parentGroup)` would
  give an optional with null value, so we'd get an error when trying to
  access ->name from that
@bpow bpow mentioned this pull request Dec 17, 2024
@bpow
Copy link
Copy Markdown
Collaborator Author

bpow commented Dec 17, 2024

Replacing with #96

@bpow bpow closed this Dec 17, 2024
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