-
Notifications
You must be signed in to change notification settings - Fork 425
Edit push #3959
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
base: master
Are you sure you want to change the base?
Edit push #3959
Conversation
…ions and UI updates
…trols in UI tests
|
Hello @LukasMalyszko, thank you for submitting a PR! We will respond as soon as possible. |
|
it got pretty big |
|
@ozovalihasan, @pglombardo
547 runs, 3599 assertions, 2 failures, 0 errors, 0 skips |
|
|
||
| class AuditLog < ApplicationRecord | ||
| enum :kind, [:creation, :view, :failed_view, :expire, :failed_passphrase, :admin_view, :owner_view], validate: true | ||
| enum :kind, [:creation, :view, :failed_view, :expire, :failed_passphrase, :admin_view, :owner_view, :update], suffix: true, validate: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why suffix: true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand, update! method is tried to be added by enum, but same method is already defined by ActiveRecord, so it is raising an error. Changing kind of audit logs like updation should be enough instead of using suffix.
The tests pass on master branch so it's definitely something in this branch. I'll add a few comments/questions. |
| self.expired = true | ||
| self.expired_on = Time.current.utc | ||
| save | ||
| save(validate: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? I would think validations should still pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, validations shouldn't be disabled. There may be some edge cases to disable them, but I think it is not necessary to disable them when editing pushes feature is implemented.
| user: @luca | ||
| ) | ||
|
|
||
| # Manually set expired without triggering validations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - if skipping validations is needed, we should explain why.
|
Ok I think I found the cause of the test failures. It's because you are skipping validations with The model validations enforce user preferences and app settings. Without those, we break a lot of functionality. |
|
Thanks for the feedback; it'll help me understand the issue. I definitely need to spend more time on this. |
Description
This pull request introduces support for editing and updating existing pushes, including the necessary backend logic, validations, UI updates, and audit logging. It ensures that users can only edit their own, non-expired pushes, and that all changes are tracked in the audit log. The forms and UI are updated to reflect the edit/update workflow, providing a seamless experience for users updating their pushes.
Related Issue
Type of Change
Checklist
rake test)