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 project tags to RUT listing/export #6722

Merged

Conversation

matusdrobuliak66
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 commented Nov 14, 2024

What do these changes do?

  • Goal/Current Use Case:

    • The financial department wants to create tags corresponding to billed projects. Users will then add these tags to the studies they are working on. (This should also be possible retrospectively.)
    • When a CSV file with resource usage is exported, it should include the project tags.
  • Current Challenges:

    • Currently, the resource tracker stores all information only at the start of the service run. This approach is insufficient because tags need to be added retrospectively.
    • Simply joining the current project_tags table poses an issue: if a project is deleted, its information would be lost and would no longer be listed. (Currently, the RUT maintains the complete history of runs, so it needs access to the project tags even after the project are deleted.)
  • Proposed Solutions:

    1. Primary Solution:
      Use the project_tags table, but instead of deleting rows when a project is deleted, mark them as deleted. This ensures they are not listed anymore but remain accessible for historical purposes.

    2. Alternative Solution:
      Keep a second copy of the project_tags table in the RUT. However, this introduces challenges in maintaining synchronization—not only when a tag is added or removed from a project, but also when the tag resource itself is deleted or updated. (started to implement but I do not think it is a good way to go: WIP: ✨ adding tags to RUT #6708)

I found solution 1. more reasonable to implement.

  • Implemented behavior:

    • Always display the latest project tags in the listing of service runs.
    • If a project is deleted, retain and display the previously associated tags in the listing.
    • If a tag resource is deleted, the tag will also be removed from all previous service runs.
    • If a tag resource is renamed, it will be updated across all previous service runs.

Related issue/s

How to test

Dev-ops checklist

@matusdrobuliak66 matusdrobuliak66 self-assigned this Nov 14, 2024
@matusdrobuliak66 matusdrobuliak66 added a:webserver issue related to the webserver service a:resource-usage-tracker resource usage tracker service labels Nov 14, 2024
@matusdrobuliak66 matusdrobuliak66 added this to the Event Horizon milestone Nov 14, 2024
@matusdrobuliak66 matusdrobuliak66 marked this pull request as ready for review November 14, 2024 13:08
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.60%. Comparing base (d3e12a3) to head (ef71774).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6722      +/-   ##
==========================================
+ Coverage   87.72%   88.60%   +0.87%     
==========================================
  Files        1570     1373     -197     
  Lines       63320    56528    -6792     
  Branches     2119     1131     -988     
==========================================
- Hits        55550    50086    -5464     
+ Misses       7443     6267    -1176     
+ Partials      327      175     -152     
Flag Coverage Δ
integrationtests 64.88% <ø> (-0.04%) ⬇️
unittests 86.33% <100.00%> (+0.63%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library 92.01% <100.00%> (+<0.01%) ⬆️
pkg_notifications_library 83.79% <ø> (ø)
pkg_postgres_database 87.33% <100.00%> (+<0.01%) ⬆️
pkg_service_integration 71.44% <ø> (ø)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.27% <ø> (ø)
agent 96.98% <ø> (ø)
api_server 89.88% <ø> (ø)
autoscaling 95.22% <ø> (ø)
catalog 89.42% <ø> (ø)
clusters_keeper 98.72% <ø> (ø)
dask_sidecar 91.32% <ø> (ø)
datcore_adapter 94.05% <ø> (ø)
director 58.43% <ø> (+0.04%) ⬆️
director_v2 90.87% <ø> (+0.06%) ⬆️
dynamic_scheduler 96.59% <ø> (ø)
dynamic_sidecar 89.78% <ø> (+0.03%) ⬆️
efs_guardian 90.01% <ø> (ø)
invitations 93.51% <ø> (ø)
osparc_gateway_server 85.15% <ø> (-0.27%) ⬇️
payments 92.87% <ø> (ø)
resource_usage_tracker 90.80% <100.00%> (+0.02%) ⬆️
storage 89.76% <ø> (ø)
webclient ∅ <ø> (∅)
webserver 88.72% <ø> (+0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3e12a3...ef71774. Read the comment docs.

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

great!

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

thanks!

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

pleas check the project.id field which looks strange

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

very nice!

@matusdrobuliak66 matusdrobuliak66 enabled auto-merge (squash) November 15, 2024 09:31
@matusdrobuliak66
Copy link
Contributor Author

@odeimaiz I was thinking it might be useful to show a pop-up when a user is deleting a tag, indicating that the tag will also be removed from the Resource Usage history

@matusdrobuliak66 matusdrobuliak66 merged commit 7e1ccbd into ITISFoundation:master Nov 15, 2024
86 of 88 checks passed
@matusdrobuliak66 matusdrobuliak66 deleted the add-tags-to-rut-V2 branch November 15, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:resource-usage-tracker resource usage tracker service a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tags to Resource Tracker (Reporting)
4 participants