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 start date to report schedule #3701

Merged
merged 19 commits into from
Oct 28, 2024

Conversation

madelondohmen
Copy link
Contributor

@madelondohmen madelondohmen commented Oct 17, 2024

Changes

This PR adds the start date input to the Report Schedule section on the Export Setup page in the report flow.
This allows a user to select the start date of the scheduled report.

It also changes the text “This field is required” to “(Required)” because it was not compliant with the designs. The changes are applied to all forms in KAT.

Issue link

Closes #2779

Demo

afbeelding

QA notes

  • Create a new report and select "Yes, repeat"
  • Select a date
  • After creating a recipe, check if the selected date is visible in the table on the Scheduled Reports page

Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@madelondohmen madelondohmen self-assigned this Oct 17, 2024
@madelondohmen madelondohmen requested a review from a team as a code owner October 17, 2024 16:13
@@ -97,13 +97,13 @@ def get_report_schedule_form_start_date_choice(self):
return self.report_schedule_form_start_date_choice(self.request.POST)

def get_report_schedule_form_start_date(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed t be on the scheduler view? Its report related right? Maybe this should be on the repor or on a reportView mixin? The same for the following 4 methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comes from another PR (#3597). @Rieven, can you answer this question?

Besided this, I'm not sure if we need to fix this in this PR. Might be better to create a new one.

Copy link
Contributor

@Rieven Rieven Oct 22, 2024

Choose a reason for hiding this comment

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

Yes, I put this in the SchedulerView, but maybe it is better to move it to the BaseReportView. The idea was that the "schedule" is part of the Scheduler as you enter a start date and recurrence which needs form validation from the scheduler side if for example the schedule did not start or Scheduler throws a ConnectionError. The other part is that if we need a scheduler elsewhere where we implement the same start date and recurrence we have it already in place in the SchedulerView.

ammar92
ammar92 previously approved these changes Oct 22, 2024
Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

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

No remarks

ammar92
ammar92 previously approved these changes Oct 24, 2024
@noamblitz
Copy link
Contributor

noamblitz commented Oct 24, 2024

QA checklist for PR's

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.
  • I checked the logs for errors and/or warnings and made issues where necessary

What works:

Start date is added to table

What doesn't work:

image

Regression on add ooi?

Bug or feature?:

Scheduled a report with start date today, the report was scheduled for 24 oct, midnight. I expect that to be coming night, and not previous night, report was created though. That signals to me that the start date is not correctly passed or something like that?

@madelondohmen
Copy link
Contributor Author

Bug or feature?:

Scheduled a report with start date today, the report was scheduled for 24 oct, midnight. I expect that to be coming night, and not previous night, report was created though. That signals to me that the start date is not correctly passed or something like that?

That's what you'd expect, right? If you want to schedule it for today, then it should be scheduled for 25-10-2024 00:00, not for the next day (26-10-2024 00:00). Otherwise you should select the 26th.

Maybe @HeleenSG has a thought about this: from the user's perspective, what whould you expect to happen?

@madelondohmen
Copy link
Contributor Author

@noamblitz the forms with "(Required)" should be fixed now

@stephanie0x00
Copy link
Contributor

Created a new ticket to discuss the timestamping issue as mentioned above: #3738.

This PR has been tested and it works for now, thus can be merged.

Copy link

@underdarknl underdarknl merged commit 75de529 into main Oct 28, 2024
22 checks passed
@underdarknl underdarknl deleted the feature/add-start-date-to-report-schedule branch October 28, 2024 11:26
jpbruinsslot added a commit that referenced this pull request Nov 6, 2024
* main:
  Fix reports with organization tags (#3790)
  Update README.rst - Fix guidelines URLs (#3789)
  Exclude Report from ooi list (#3768)
  Update `croniter` (#3767)
  Fixes for dropdowns (#3732)
  Fix scheduled Aggregate Report naming (#3748)
  Make systemctl call for kat-rocky-worker conditional (#3782)
  Fix vulnerability chapters in Aggregate table of content (#3780)
  Fix auth token middleware with wrong format header (#3755)
  Add rocky REST API for report recipes (#3746)
  Add exception handling to the rest api (#3708)
  Refactor Multi Report to comply to the new report flow (#3705)
  Fix report names for scheduled reports (#3726)
  Fix Multi Report recursion error (#3714)
  Bump waitress from 3.0.0 to 3.0.1 in /octopoes (#3760)
  Docs/add muted findings (#3699)
  Edit report recipe (#3690)
  Add start date to report schedule (#3701)
  Add REST API to list report and download pdf report (#3689)
  Fixes in Report Overview (#3707)
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.

Export setup - report schedule
7 participants