Commit Graph

82 Commits

Author SHA1 Message Date
Kenneth Kehl
431a09e3cf fix test 2025-03-04 11:07:52 -08:00
Kenneth Kehl
7de239c660 fix test 2025-03-04 10:57:41 -08:00
Kenneth Kehl
dee22b893b fix test 2025-03-04 10:48:09 -08:00
Kenneth Kehl
0255ef7bdc fix test 2025-03-04 10:35:03 -08:00
Kenneth Kehl
295d95b5b1 fix test 2025-03-04 10:24:38 -08:00
Kenneth Kehl
c2a67915a8 merge from main 2025-03-03 11:24:29 -08:00
Kenneth Kehl
5e5f28b313 merge from main 2025-03-03 10:53:56 -08:00
Kenneth Kehl
3388371428 fix filter_bys 2024-12-19 11:10:03 -08:00
Kenneth Kehl
c0ed18cd49 merge from main 2024-10-29 14:29:39 -07:00
Kenneth Kehl
57df2f6d96 code review feedback 2024-10-29 14:29:25 -07:00
Kenneth Kehl
4d276ad4fe hmmm 2024-10-28 14:20:54 -07:00
Kenneth Kehl
61cf576faf hmmm 2024-10-28 14:01:06 -07:00
Kenneth Kehl
9c95e588d1 remove all() from statement 2024-10-15 13:13:42 -07:00
Beverly Nguyen
0914cd9b5d Merge pull request #1304 from GSA/API-1265_adding_fields_for_template_stats
Api 1265 adding fields for template stats
2024-08-29 12:32:41 -07:00
Cliff Hill
4084a18327 I think it is working now.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-08-28 15:05:42 -04:00
Kenneth Kehl
961e9913de fix 2024-08-16 11:54:57 -07:00
Kenneth Kehl
0cd6b503e8 fix test 2024-08-16 11:40:11 -07:00
Anastasia Gradova
b2e5522d09 Corrected test cases for new stats endpoints 2024-06-24 17:58:37 -06:00
Kenneth Kehl
905df17f65 remove datetime.utcnow() 2024-05-23 13:59:51 -07:00
Cliff Hill
11992be740 Fixing things is fun.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 15:54:35 -05:00
Cliff Hill
43a8b6539f More fixes, removing literal "created" from code.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:58:22 -05:00
Cliff Hill
63aa12e4ef More cleanup.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:44:21 -05:00
Cliff Hill
f27964812c More cleanup.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:44:20 -05:00
Cliff Hill
2655dc60cd Stuff was done.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:44:19 -05:00
Cliff Hill
689ff10b71 Latest and greatest.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:44:18 -05:00
Cliff Hill
b1a53c76ee More cleanup.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:44:18 -05:00
Cliff Hill
26bc6198f8 Cleaning up tests.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:34 -05:00
Cliff Hill
8c6046b03b Cleaning up tests.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:33 -05:00
Cliff Hill
df10c4693c Formatting goodness.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:31 -05:00
Cliff Hill
df866e40f7 More Enum goodness.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:27 -05:00
Cliff Hill
43f18eed6a More changes for enums.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:41:57 -05:00
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Kenneth Kehl
5a350560d7 notify-api-433b remove research mode 2023-08-25 12:09:00 -07:00
Steven Reilly
ff4190a8eb Remove letters-related code (#175)
This deletes a big ol' chunk of code related to letters. It's not everything—there are still a few things that might be tied to sms/email—but it's the the heart of letters function. SMS and email function should be untouched by this.

Areas affected:

- Things obviously about letters
- PDF tasks, used for precompiling letters
- Virus scanning, used for those PDFs
- FTP, used to send letters to the printer
- Postage stuff
2023-03-02 20:20:31 -05:00
stvnrlly
9e7ee1c0f8 migrate bst_date to local_date 2022-11-21 11:49:59 -05:00
stvnrlly
b50cb4712f tz utility swap and many test updates 2022-11-10 12:33:25 -05:00
Ben Thorner
4a40b169a2 Fix flakey test for notification status
This was creating data in the Notifications table but the funcetion
under test was - now the timestamps are in the past - looking in the
NotificationHistory table. Freezing the time of the test fixes that.
2022-04-05 11:07:05 +01:00
Ben Thorner
a69d1635a1 Update FactStatus table in bulk for each service
Previously we were looping over data from the Notifications/History
table and then shovelling it into the status table, one row at a time
- plus an extra delete to clean up any existing data.

This replaces that with a batch insertion, similar to how we archive
notifications [1], but using a simple subquery (via "from_select" [2])
instead of a temporary table.

To make the select compatible with the insert, I've used "literal"
to inject the constant pieces of data, so each row has everything it
needs to go into the status table.

[1]: 9ce6d2fe92/app/dao/notifications_dao.py (L295)
[2]: https://docs.sqlalchemy.org/en/14/core/dml.html#sqlalchemy.sql.expression.Insert.from_select
2022-02-16 13:40:05 +00:00
Ben Thorner
6e8f121548 Standardise how we query midnight-to-midnight
Partially addresses [1] (lots more detail to read in the comment).
I've also added some tests for the status DAO function to confirm
it behaves as expected across timezones.

[1]: https://github.com/alphagov/notifications-api/pull/3437#discussion_r802634913
2022-02-10 10:51:27 +00:00
Ben Thorner
9fc8b904c6 DRY up status aggregation tests (move DAO tests up)
The previous DAO tests were also confusing because they were testing
two functions at the same time, so moving the tests up to the task
level seems very reasonable, and will make it easier to change how
this code works in the next commits.
2022-01-11 16:11:36 +00:00
Ben Thorner
394bf9abd9 Extend test for updating fact statuses
This covers that we only exclude test notifications and the key
type is copied over correctly. In the next commits we're going to
modify this part of the query, so it's important it's covered.
2022-01-05 16:49:30 +00:00
Pea Tyczynska
c28e9451d4 Bump moto version to try solve dependencies version conflict
Also update mock import statements in some test files as they
stopped working with this dependency update.
2021-07-08 15:37:19 +01:00
Rebecca Law
684a882cf3 Revert "Do not include today's totals" 2021-06-02 16:06:33 +01:00
Rebecca Law
a341536de0 - Add comment to test and new if statement
- Update assert in test
2021-06-02 14:13:31 +01:00
Rebecca Law
b170b5ed80 This change is a temporary fix to allow users for high volume services to use the admin app.
The trouble is the aggregate query to return the big blue numbers on the dashboard and /notifications/{notification_type} page is taking too long to return.
I have some ideas on how to improve the query, but should take some time to do some more research and test. In the meantime, let's just ignore "todays" total numbers for the high volume services. There are only two services that this will affect.
2021-06-02 10:31:38 +01:00
David McDonald
04e23ca6a9 Revert "Bump utils version for new invalid address character" 2021-06-01 10:53:28 +01:00
Rebecca Law
f66f0a2e2d Bump moto dependency to resolve dependency conflicts 2021-05-25 14:20:25 +01:00
David McDonald
41d95378ea Remove everything for the performance platform
We no longer will send them any stats so therefore don't need the code
- the code to work out the nightly stats
- the performance platform client
- any configuration for the client
- any nightly tasks that kick off the sending off the stats

We will require a change in cronitor as we no longer will have this task
run meaning we need to delete the cronitor check.
2021-03-15 12:04:53 +00:00
Ben Thorner
a91fde2fda Run auto-correct on app/ and tests/ 2021-03-12 11:45:45 +00:00
Rebecca Law
11d10d5293 Rename to performance_dashboard
Fix totals to return totals for all time rather than for date range.
Added more test data
2021-03-10 13:16:25 +00:00