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

feat: add edited_at field to activation #1199

Open
wants to merge 1 commit into
base: feature/edit-activation
Choose a base branch
from

Conversation

bzwei
Copy link
Collaborator

@bzwei bzwei commented Jan 24, 2025

Expose this field in API for activations. Also write the field to rulebook process log if the activation has been edited.

implements AAP-38382

Screenshot 2025-01-24 at 3 00 52 PM

@bzwei bzwei requested a review from a team as a code owner January 24, 2025 15:59
Expose this field in API for activations. Also write the field
to rulebook process log if the activation has been edited.

implements AAP-38382
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (feature/edit-activation@542cd81). Learn more about missing BASE report.

@@                    Coverage Diff                     @@
##             feature/edit-activation    #1199   +/-   ##
==========================================================
  Coverage                           ?   93.47%           
==========================================================
  Files                              ?      263           
  Lines                              ?    15179           
  Branches                           ?        0           
==========================================================
  Hits                               ?    14189           
  Misses                             ?      990           
  Partials                           ?        0           
Flag Coverage Δ
unit-int-tests-3.11 93.41% <100.00%> (?)
unit-int-tests-3.12 93.47% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/aap_eda/api/serializers/activation.py 95.93% <100.00%> (ø)
...p_eda/core/migrations/0057_activation_edited_at.py 100.00% <100.00%> (ø)
src/aap_eda/core/models/activation.py 100.00% <100.00%> (ø)
.../aap_eda/services/activation/activation_manager.py 63.36% <100.00%> (ø)
tests/integration/api/test_activation.py 98.72% <100.00%> (ø)
...ts/integration/services/activation/test_manager.py 100.00% <100.00%> (ø)

@bzwei bzwei added the run-e2e label Jan 24, 2025
"%Y-%m-%dT%H:%M:%S.%fZ"
)
log_handler.write(
f"The activation was edited at {edited_at}", flush=True
Copy link
Contributor

Choose a reason for hiding this comment

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

@bzwei @hsong-rh How would this be handled in the UI, should the UI display a separate field which is TZ aware when displaying the Edited At. The logs are good for record keeping, so we should keep this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bzwei Can you paste a screen shot of the Activation log in this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

@bzwei To be consistent can be use the created_at if the edited_at is missing that way the log will remain the same.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mkanoor The edited_at timestamp is not the message logging time. It is part of the log message, just like other timestamps appear in the output. Screenshot is posted.
I purposely not log the edited time if not present. When it is missing, it is an indication that the activation is original, never updated. Or perhaps I can write a message here "The activation has never been edited"

Copy link
Contributor

Choose a reason for hiding this comment

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

@bzwei Thats ok leave it the way it is for now. Did you forget to the add the screen shot?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mkanoor I posted screen shot but it did not get displayed somehow. Now it is visible

@bzwei bzwei removed the run-e2e label Jan 24, 2025

class Migration(migrations.Migration):
dependencies = [
("core", "0056_alter_activation_options"),
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this 0056 migration file? do you miss it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

0056 migration exists in feature/edit-activation branch

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.

4 participants