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

ID-1046 Migrate listResourcesAndPoliciesV2 to new query #1326

Merged
merged 7 commits into from
Feb 1, 2024

Conversation

tlangs
Copy link
Contributor

@tlangs tlangs commented Jan 29, 2024

Ticket:

What:
Instead of making everyone else migrate to a new listResourcesV2 endpoint, why not just change the query powering the listResourcesAndPoliciesV2 under the hood?

Why:

Lessen the load on everyone else.

How:

Adapt the db response to the response type of listResourcesAndPoliciesV2


PR checklist

  • I've followed the instructions if I've made any changes to the API, especially if they're breaking changes
  • I've filled out the Security Risk Assessment (requires Broad Internal network access) and attached the result to the JIRA ticket

@tlangs tlangs changed the title Migrate listResourcesAndPoliciesV2 to new query ID-1046Migrate listResourcesAndPoliciesV2 to new query Jan 30, 2024
@tlangs tlangs changed the title ID-1046Migrate listResourcesAndPoliciesV2 to new query ID-1046 Migrate listResourcesAndPoliciesV2 to new query Jan 30, 2024
@tlangs tlangs marked this pull request as ready for review January 30, 2024 19:51
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
1.3% Duplication on New Code

See analysis details on SonarCloud

samUser: SamUser,

private val publicResourcesCache: java.util.Map[ResourceTypeName, Seq[FilterResourcesResult]] =
Collections.synchronizedMap(new PassiveExpiringMap(1, TimeUnit.HOURS))
Copy link
Contributor

Choose a reason for hiding this comment

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

1 hour seems like a while, am i correct in thinking that if someone changes a public resource itll take an hour to propagate that change? Do you see that causing any problems?

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 don't think it would be a problem. Publicizing workspaces is a manual process undertaken by Support, so we can just instruct them that it can take up to an hour for a public workspace to appear.

Copy link
Contributor

@samanehsan samanehsan left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@tlangs tlangs merged commit 3addbe2 into develop Feb 1, 2024
21 checks passed
@tlangs tlangs deleted the tl_migrate_listResourcesAndPoliciesV2 branch February 1, 2024 16:39
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.

3 participants