Граф коммитов

105 Коммитов

Автор SHA1 Сообщение Дата
Daniel Smith a19fad825b
Display existing gates for approvals dialog (#2782)
* intent thread detection refactoring

* add gate info to verbose converter

* Display approvals dialog based on existing gates

* Display approvals sorted intuitively

* revert unrelated changes

* remove more unrelated changes

* code cleanup and comments

* small typo
2023-03-02 10:45:58 -08:00
Daniel Smith d43a0e6aaa
Spec mentors can edit features in which they are listed as a mentor (#2660)
* spec mentors can edit features

* Check that spec_mentor_emails is not null
2023-01-12 12:36:14 -08:00
Jason Robbins 1102381e68
Introduce permission to comment. More perms checks in approvals dialog. (#2582) 2022-12-13 12:56:08 -08:00
Daniel Smith a58d2bda77
Create Stages API (#2535)
* Add new stages API

* add routes and mypy

* changes/fixes suggested by @jrobbins
2022-12-05 13:10:14 -08:00
Daniel Smith d331c4540e
Add new route dataclass (#2456)
* Add new route dataclass

* add blank line
2022-11-09 10:06:59 -08:00
Daniel Smith e2ce1d405e
Use FeatureEntry for most client-side use cases (#2433)
* Use FeatureEntry entity for most client-side uses

* leave notify and amendments to Feature for now

* handle redis keys
2022-11-06 12:57:40 -08:00
Jason Robbins d9eb639ac5
Display a "Comments & activity" log at the bottom of the feature detail page. (#2413)
* Intial code for display of amendments

* tests

* More tests, and avoid showing non-useful amendments

* More tests

* Put Loading... in a paragraph tag.

* Indent amendment details
2022-11-02 13:58:37 -07:00
Daniel Smith 87a7a23d1f
Move Feature methods to helper files (#2407)
* type hints

* Revert "type hints"

This reverts commit 9ffab5aabd.

* Move feature functions to separate helpers file

* remove import

* more import removal

* end of file newline

* mypy ignore ndb

* @jrobbins review changes

- Removed older standardization field logic
- Added TODO for migration script for values in migrate_views()
2022-10-27 10:17:54 -07:00
James C Scott III dad9bcceb6
Remove RSS functionality and dependencies (#2393)
Fixes #2366
2022-10-25 12:17:23 -04:00
Daniel Smith 49fb21595d
Run mypy in Github continuous integration checks (#2324)
* run mypy in CI

* more type hint fixing

* Update requirements.txt

* google.cloud import workaround

https://github.com/python/mypy/issues/10360

* Revert "google.cloud import workaround"

This reverts commit e03dbc7bbeb67acc81f57b9c5d905b9141952dbc.

* mypy google.cloud workaround

https://github.com/python/mypy/issues/12985

* fix regular tests

* remove --install-types flag

* last mypy fix

* type fixes for address_reasons

* move email lists creation

* update for newly merged changes

* Fix regular tests

* Changes suggested by @jrobbins

* Catch invalid requests

* small type hint

* Change methods to properly override

* revert to previous implementation

* revert test

* add back original validate request type method

* remove unused import and rearrange methods

* remove comment string casting; add test back

* add ndb ignore

* Update test_html_rendering.html

* mypy fix

* remove merge addition
2022-10-24 06:40:21 -07:00
Kyle Ju 582a594aa8
Use get_int_arg for integer arg parsing (#2359)
* Replace with get_int_arg usage

* Address comments

Co-authored-by: Kyle Ju <kyleju@chromium.org>
2022-10-19 14:08:42 -07:00
James C Scott III ad9ee9ae31
Remove all references to django (#2358)
* Remove all references to django

Replace any functionality with flask

* more cleanup

* fix template test after removing empty comment

* remove unused test_app
2022-10-19 13:51:39 -04:00
James C Scott III 385d62374b
Add assertions for the templates in #2355 (Part 2 of 2) (#2356)
* Add assertions for the templates in #2355

- Move the TESTDATA functionality to a testing_config to be a test helper.
In this new helper, users can still retreive from it like a dictionary.
In addition, there's a helper function to help make goldens that can be
used to regenerate the golden templates. Add commented out
code to use it.
- Add some clean ups to individual tests or test cases. This was needed
because some of the existing rendering tests would pull from the database.
But since they only asserted for the existence of some values, it did
not matter. In the future, we can add mocks for all of those.
  - These cleanups also help for more than the rendering tests. Before these fixes, there were ~15 non-rendering tests that would fail if a developer ran the full suite with a clean db, then re-ran a test indivdually without resetting the database. There are still 2 non-rendering tests that fail without clearing the database first. But this first iteartion got a lot of them.
- Add a missing test for the PrepublicationHandler to increase coverage

* address comments

* more cleanup
2022-10-19 10:14:52 -04:00
Kyle Ju dca47ebe61
Unify int arg parsing (#2357)
Co-authored-by: Kyle Ju <kyleju@chromium.org>
2022-10-18 15:22:38 -07:00
James C Scott III ea1e4a325d
Add templates for tests (#2355)
This is a split of #2323. In order to make that PR readable, I split that up.
This commit only contains the testdata.
2022-10-18 15:29:42 -04:00
Daniel Smith 9ed293d7a2
Change existing handler classes to properly override request methods (#2342)
* Change methods to properly override

* Update comments_api.py

* Update comments_api.py
2022-10-16 08:39:35 +02:00
Daniel Smith 3d511e4553
Some introductory type hinting and refactoring (#2319)
* some introductory type hinting and refactoring

* Update user_models.py
2022-10-12 09:16:36 +02:00
Daniel Smith 75b7c85953
default values for some required fields (#2310) 2022-10-10 19:43:40 +02:00
James C Scott III 9e35ea1353
Replace django templates for email with jinja2 templates (#2276)
* Replace django templates for email with jinja2 templates

This commit converts the email templates from django templates to jinja2
templates.

It also creates a new helper function: flask_compat_get_template_path

This function uses the existing configuration for django templates and
uses it to return a string used to locate the templates for jinja2.

Fixes #2030

* Add rendered test templates for email notifications

* ignore testdata folder for gcloud
2022-09-28 12:44:32 -04:00
Kyle Ju b51a007c92
Add retry configurations for Redis (#2270)
Co-authored-by: Kyle Ju <kyleju@chromium.org>
2022-09-26 11:11:45 -07:00
Kyle Ju eea1a0ab80
Add health_check_interval to avoid connection reset (#2259)
Co-authored-by: Kyle Ju <kyleju@chromium.org>
2022-09-20 09:55:08 -07:00
Daniel Smith a49ef32b30
Handle inactive users (#2243)
* handle inactive users

Notify inactive users at 6 months and remove inactive users at 9 months

* Changes suggested by @jrobbins

* update comment
2022-09-15 13:43:22 -07:00
Kyle Ju fe65355d6a
Completely migrate feature-related cache off ramcache (#2234)
* Implement scan

* Migrate feature cache

* Address comments

* Fix

* Add cache_key argument

Co-authored-by: Kyle Ju <kyleju@chromium.org>
2022-09-14 10:07:32 -07:00
Jason Robbins 0fc62d05ff
Clarify where we load features directly from the DB, not cache. (#2239) 2022-09-13 16:30:34 -07:00
Kuan-Hsuan (Kevin) Shen a9844400b1
Launch the SPA (#2224)
* Launch the SPA

* Remove unused imports

* Address comments

* Avoid pushState when url has already matched
2022-09-13 14:54:32 -04:00
Kyle Ju e5f9a7b642
Create Redis staging setup (#2211)
* Redis staging setup

* Add an if for staging

* Implement Redis caching APIs (#2212)

* Redis APIs

* Nit

* Partially migrate Ramcache usage to Redis (#2214)

* Migrate all fields except feature-related cache

* Fix

* Address comments

Co-authored-by: Kyle Ju <kyleju@chromium.org>

Co-authored-by: Kyle Ju <kyleju@chromium.org>

Co-authored-by: Kyle Ju <kyleju@chromium.org>
2022-09-12 13:56:50 -07:00
Jason Robbins 772225dbb3
Guard cron handlers. (#2229) 2022-09-12 10:52:53 -07:00
Jason Robbins 63fafb4745
Fix passing user object from features.html to chromedash-featurelist. (#2182) 2022-08-29 15:20:52 -07:00
Jason Robbins c9576a2565
Fix serving of farewell-rss.xml (#2176) 2022-08-29 11:49:16 -07:00
Daniel Smith 9970ec3d7a
Enable new permissions system (#2174)
* enable new permissions

* review changes
2022-08-26 15:30:55 -07:00
Jason Robbins 697cf9b38d
Refactor remaining models.py code into core_models.py (#2160)
* Refactor remaining models.py to core_models.py.

* Move tests to the right _test file.
2022-08-23 16:00:02 -07:00
Jason Robbins 689483c0f3
Refactor user-related models into a separate file. (#2141) 2022-08-17 18:14:19 -07:00
Jason Robbins 03ed01a8f0
Replace more obsolete page handlers with ConstHandler. (#2114)
* Replace more obsolete page handlers with ConstHandler.

* Also replace the user settings page.
2022-08-14 08:05:17 -07:00
Jason Robbins 7866c63100
Sort pending reviews by review request date via sort= query string param (#2082)
* progress

* Finished and added python tests.

* removed commented-out code
2022-08-03 15:25:17 -07:00
Daniel Smith 9c68386cb7
Temporary editing permissions (#2069)
* Update guide.py

* check if user is already an editor

* typo fix
2022-07-28 15:34:47 -05:00
Daniel Smith 8ee81f5d82
Create new creator field for features (#2034)
* add creator field

* cron job to add creator field

* changes suggested by @jrobbins

* add logging
2022-07-20 09:43:19 -07:00
Daniel Smith 6bc5ebb3c4
update last_visit on token refresh or login (#2051) 2022-07-20 09:42:46 -07:00
Jason Robbins 4cbeb7e983
Only set non-None reply_to header. (#2045) 2022-07-19 09:22:21 -07:00
Jason Robbins 09a9a09992
Add Reply-To header to email notifications. (#2031)
* Add Reply-To header to email notifications.

* Update internals/notifier_test.py

Co-authored-by: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>

Co-authored-by: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
2022-07-15 16:24:21 -07:00
Jason Robbins 93a746a208
Make roadmap page the site homepage. (#2025) 2022-07-15 09:57:51 -07:00
Daniel Smith 83e77b9d5b
New permissions system implementation (#2011)
* Check edit permissions by individual feature

* update logic to check permissions

* editors field added

* editors can see edit access in UI

* myfeatures shows editable features

* Make editor field plural

* 1 more plural update

* change var name for site editor

* Editors can delete a feature

* Site editors can now be designated in admin ui

* fix existing tests to work with new changes

* feature and permissions tests

* accounts and models test

* new creator field

* update tests for creator field

* code cleanup

* add creator field to new feature

* unlisted features are displayed in "My Features"

If the user is the creator, an owner, or an editor.

* slight update in unlisted features logic

* My features displays all editable features

in a single dropdown.

* fix web tests

* add test to ensure creator can edit feature

* remove unused _reject_or_proceed() change

* remove mangle and log statement

* Set original permissions

All changes to permissions.py removed.
This commit can be reverted to enable to new permissions system.

* changes suggested by @jrobbins

* update from merge

* remove creator field for later implementation

* changes suggested by @jrobbins
2022-07-13 14:31:27 -07:00
Kuan-Hsuan (Kevin) Shen 40f7323144
Add permissions API and move all feature content and js scripts into feature-page component (#1972)
* Add process and fieldDefs APIs and move components

* Add processes, cues, fielddefs tests

* Fix typos

* Add `permissions_api` and clean up `feature.html`

* Add permissions_api test and improve feature page test

* Change TODOs, rename test response variables
2022-06-25 10:54:02 -04:00
Jason Robbins deb8ff83c9
Use long Expires with GAE version as buster. (#1969) 2022-06-24 14:42:31 -07:00
Jason Robbins 7f28aae8d1
Add flask_cors unit test. (#1936) 2022-06-15 10:59:11 -07:00
Kyle Ju 85faec04ae
Enable CORS for data/* (#1922)
* Test Flask-Cors

* Add a CORS test for data/*
2022-06-14 18:01:17 -07:00
Jason Robbins df4aec4cf2
Send and receive emails in py3 using GAE legacy libraries (#1923)
* Progress

* Send and receive emails in py3 using GAE legacy libraries.

* No need to run py2 unit tests when there are none

* Addressed review comments.
2022-06-10 14:56:40 -07:00
Jason Robbins 1d5d66f081
Add anti-framing header to all responses. (#1913) 2022-06-03 10:51:44 -07:00
Kyle Ju c570bfbe47
Remove CORS all permissive header (#1875)
* Remove * from CORS

* Address comments

* Fix failing tests
2022-05-19 15:14:04 -07:00
Jason Robbins d10158d9f5
Remove backward compat with Google Sign-In. (#1883) 2022-05-13 07:58:47 -07:00
Jason Robbins ef70a1ab9e
Validate link scheme. (#1873) 2022-05-06 16:56:42 -07:00