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

2708 Коммитов

Автор SHA1 Сообщение Дата
James C Scott III f33576a5f3
Migrate admin/blink.html to SPA [5/5] (#2743)
* Migrate admin/blink.html to SPA

Add implementations of the three new API routes
Remove old code for templated admin/blink.html

* Remove old handler and template

* start of tests

* fix tests

* temp

* separate into smaller elements

* add more python tests

* fix lint for optional values

* add tests

* fix lint error

* update model names

* use global

* fix test

* fix jsdoc from renaming

* address feedback
2023-03-24 18:25:18 -04:00
James C Scott III 42817a703b
Generate new routes for admin/blink.html [4/5] (#2742)
* Generate new routes for admin/blink.html

GET /componentsusers - The getter function that list all components and possible users and whether they are owners or just subscribed
PUT /components/{componentId}/users/{userId} - Add a user to a component
DELETE /components/{componentId}/users/{userId} - Remove a user from a component

* remove redundant components

* update names
2023-03-24 18:04:20 -04:00
James C Scott III 4a2f9f6a75
Manual changes to support using openapi [3/5] (#2771)
* Manual changes to support using openapi

.devcontainer/Dockerfile
- Install java in devcontainer

.devcontainer/devcontainer.json
- Make devcontainer automatically install VSCode OpenAPI plugin mentioned in #2769
- Make devcontainer automatically install VSCode plugin for Lit

client-src/elements/chromedash-app.js
- Use the generated client in the frontend.
- Leverage lit-labs/context to provide the client.
  - Docs about context and use-cases: https://lit.dev/docs/data/context/

client-src/elements/chromedash-app_test.js
- Add tests for the changes in client-src/elements/chromedash-app.js

client-src/contexts/openapi-context.js
- Declare a context for the openapi client.

framework/basehandlers.py
- add do_put function. previously, all other HTTP verbs had a `do_<verb>` version except PUT.
- Add put function that uses defensive_jsonify. This enables XSSI for PUT requests.
  - This needed change is safe to do because the only route using PUT is the admin/blink page which I am migrating into the SPA.

gulpfile.babel.js
- Fix usage of rollupBabel. Previously, @rollup/plugin-node-resolve's default export was named rollupBabel. Which is the wrong package. Fixed to use @rollup/plugin-babel
- Using the correct parameters to rollupBabel from https://www.npmjs.com/package/@rollup/plugin-babel
- Add client-src/contexts/*.js to lint and watch targets
- Add custom onwarn for rollup that comes from using the generated frontend code. Check comment for explanation

package.json
- Add lit-labs/context. Needed for changes in client-src/contexts/openapi-context.js
- Tell NPM to use the generated javascript changes via the `workspaces` key.
  - Instead of adding as a dependency like [I initially did here](ccd5c8e71b (diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R101)), rather keep the "dependencies" only for ones pulled from npm remotely.
  - workspaces are meant more for packages that comes from the filesystem
  - Docs: https://docs.npmjs.com/cli/v9/using-npm/workspaces?v=true

requirements.txt
- Tell pip to install the python package.

package-lock.json
- Generated changes from adding context and workspaces.

* revert accidental Werkzeug upgrade

* fix devcontainer

* Remove context & failed attempt at global

changes:
- Remove the context
- Move the openapi client to js-src
- modify gulp task to:
  - ignore the test file
  - add the openapi-client to the rollup task instead of the js task since it is a es6 module (because it has an import / require statement)
- Attempt to construct the object in the spa template. It failed to work at load time. More details below:

When trying to call my exported class at page load like the regular client, I get a not defined error.
There are thoughts about this:
- https://stackoverflow.com/a/75026222
- https://stackoverflow.com/a/53630402
- https://stackoverflow.com/a/69888825

This commit serves as an attempt to try it out

Turns out, script type "module" is automatically set to defer and cannot be disabled.

* add new rollup for cjs for openapi client

* add more tests

* fix middleware
2023-03-24 17:46:28 -04:00
James C Scott III 0394a5ebc9
Add initial api.yaml and generated code [2/5] (#2770)
* Add initial api.yaml and generated code

Manual changes:
- api.yaml:  All the necessary fields to have a valid api.yaml.
- package.json: add `openapi`, `openapi-frontend` and `openapi-backend` scripts. Add @openapitools/openapi-generator-cli as a dependency to do the generation of the code. add gen/ folder to mypy exclusion
- .github/workflows/ci.yml: add gen/ folder to mypy exclusion

Generated changes:
- openapitools.json: Made by openapi-generator-cli on initial generate so that subsequent generation use the same pinned version of the JAR.
- gen/*: The generated code
- package-lock.json: Updated because I added the new devDependency

* use modular openapi file pattern

* add validate cmd & simplify paths file ref
2023-03-24 17:26:49 -04:00
James C Scott III 6b6aad1998
Add OpenAPI documentation [1/5] (#2769)
* Add OpenAPI documentation

Changes:

- README.md - Update mention that java is needed both the Datastore emulator (existing dependency) and now openapi-generator-cli
- developer-documentation.md - Add section about adding a new API with example
- openapi-documentation.md - Add documentation about openapi. Maintenance expectations. Explanation of each additional property.

* address feedback from @jrobbins

* remove format field

* update docs with modular openapi files

* simplify paths file ref

* Update developer-documentation.md

* Remove redundant components
2023-03-24 17:23:02 -04:00
Jason Robbins 030a96b1c2
Add roadmap check to prepub reminder email. (#2858)
* Add roadmap check to prepub reminder email.

* Use {{site_url}} for roadmap link
2023-03-23 18:18:40 -07:00
Daniel Smith 0377d1ef15
Change arguments passed to new format_email_body implementation (#2857)
* change arguments passed to new implementation

* update test as well
2023-03-23 12:11:06 -07:00
Daniel Smith 2d5bb78f0f
Update email templates to use new schema (#2837)
* Escalate accuracy verification notifications

* small comment change

* Remove unrelated change

* update templates to use new schema

* better type hinting

* update escalation check approach

* update intentpreview imports

* merge fix
2023-03-23 11:47:15 -07:00
Jason Robbins c10fc20c1d
Use "N/A" and "INT" instead of icons. (#2855)
* Use "N/A" and "INT" instead of icons.

* On hover, underline just the team name
2023-03-23 09:18:33 -07:00
Jason Robbins 61b35e0bfa
Use CSS box-shadow rather than border to highlight selected gate chip. (#2856)
* Use CSS outline rather than border to highlight selected gate chip.

* Use box-shadow to work-around a bug in safari
2023-03-23 09:18:06 -07:00
Yann Dago 4548b9790d
Add rollout impact field to rollout stages (#2813) 2023-03-22 14:25:04 -04:00
dependabot[bot] a1bd4a7dc5
npm: bump @babel/eslint-parser from 7.19.1 to 7.21.3 (#2850)
Bumps [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) from 7.19.1 to 7.21.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.21.3/eslint/babel-eslint-parser)

---
updated-dependencies:
- dependency-name: "@babel/eslint-parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 16:35:11 -07:00
Jason Robbins 0189c08ce2
Reject login/out GETs with 405 response. (#2846) 2023-03-21 16:34:54 -07:00
dependabot[bot] 8d1e540c4a
npm: bump @shoelace-style/shoelace from 2.2.0 to 2.3.0 (#2852)
Bumps [@shoelace-style/shoelace](https://github.com/shoelace-style/shoelace) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/shoelace-style/shoelace/releases)
- [Commits](https://github.com/shoelace-style/shoelace/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: "@shoelace-style/shoelace"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 15:37:16 -07:00
dependabot[bot] 9e3a933d24
npm: bump trim-newlines from 4.0.2 to 5.0.0 (#2851)
Bumps [trim-newlines](https://github.com/sindresorhus/trim-newlines) from 4.0.2 to 5.0.0.
- [Release notes](https://github.com/sindresorhus/trim-newlines/releases)
- [Commits](https://github.com/sindresorhus/trim-newlines/compare/v4.0.2...v5.0.0)

---
updated-dependencies:
- dependency-name: trim-newlines
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 15:34:50 -07:00
dependabot[bot] 4ace7e3c3b
npm: bump @babel/core from 7.21.0 to 7.21.3 (#2849)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.21.0 to 7.21.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.21.3/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 15:33:24 -07:00
dependabot[bot] cd38b125fa
npm: bump sass from 1.59.2 to 1.59.3 (#2848)
Bumps [sass](https://github.com/sass/dart-sass) from 1.59.2 to 1.59.3.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.59.2...1.59.3)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 15:32:55 -07:00
Daniel LaLiberte da14ddc484
Fix to the beforeunload handling especially for the metadata form (#2853)
* Refactoring and fix to beforeunload handling, esp for metadata form

* Apply to chromedash-metadata

* Apply to metadata form, correctly.
2023-03-21 11:29:58 -04:00
Kyle Ju 58e7f66808
Notify subscribers of a new comment (#2835)
* Notify subscribers of a new comment

* Add /tasks/email-comments notifier task

* Fix

---------

Co-authored-by: Kyle Ju <kyleju@chromium.org>
2023-03-20 10:08:24 -07:00
Daniel Smith 7405abb2e6
Remove old migration scripts (#2843)
* remove old schema migration scripts

* delete test file
2023-03-20 02:26:06 -07:00
Daniel Smith 772746640c
Escalate accuracy verification notifications after 3 weeks (#2832)
* Escalate accuracy verification notifications

* small comment change

* Remove unrelated change

* update escalation check approach

* remove unused import
2023-03-16 18:01:16 -07:00
Daniel Smith 12b91d1e6a
Create stage bug fix (#2842) 2023-03-16 17:33:40 -07:00
Daniel LaLiberte 85ea581b70
Implement beforeunload for SPA (#2811)
* Hacky implementation of beforeunload for SPA.

* Correct impl, except for Submit and Cancel buttons

* More changes to handle submit button

* Add check that we are on the same page  after the submit timeout

* Simplify beforeunload and form submit handling.
2023-03-16 20:17:02 -04:00
Daniel Smith 4ddb5bc7af
Feature accuracy verification handles multiple stages of the same type (#2827)
* update accuracy verification for multiple stages

* Update guide.py to only change fields in form

* fix touched tests

* changes suggested by @jrobbins
2023-03-16 12:32:42 -07:00
Kyle Ju c73f6a2f24
Increase review_api coverage to 100% (#2836)
* Increase review_api coverage to 100%

* fix

---------

Co-authored-by: Kyle Ju <kyleju@chromium.org>
2023-03-16 10:24:06 -07:00
Daniel LaLiberte 646b7315c7
Comments and cleanup of scroll to element utility (#2809)
* Comments and cleanup of scroll to element utility

* Comments
2023-03-16 11:38:33 -04:00
dependabot[bot] 803083be1a
npm: bump rollup from 3.18.0 to 3.19.1 (#2825)
Bumps [rollup](https://github.com/rollup/rollup) from 3.18.0 to 3.19.1.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v3.18.0...v3.19.1)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 14:38:52 -07:00
dependabot[bot] b50b39a8c3
npm: bump sinon from 15.0.1 to 15.0.2 (#2824)
Bumps [sinon](https://github.com/sinonjs/sinon) from 15.0.1 to 15.0.2.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v15.0.1...v15.0.2)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 14:38:24 -07:00
dependabot[bot] 013e5ba107
npm: bump node-fetch from 3.3.0 to 3.3.1 (#2823)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 14:37:57 -07:00
dependabot[bot] 70f4f91e1f
npm: bump sass from 1.58.3 to 1.59.2 (#2822)
Bumps [sass](https://github.com/sass/dart-sass) from 1.58.3 to 1.59.2.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.58.3...1.59.2)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 14:36:28 -07:00
dependabot[bot] 2fe7309ee6
npm: bump eslint from 8.35.0 to 8.36.0 (#2821)
Bumps [eslint](https://github.com/eslint/eslint) from 8.35.0 to 8.36.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.35.0...v8.36.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 14:35:56 -07:00
Jason Robbins 21f6ab692f
Comment out privacy and security gates until we get questionnaires. (#2830) 2023-03-15 11:40:28 -07:00
Kyle Ju a1653c3745
Increase stages_api coverage to 100%, plus a drive-by fix (#2829)
Co-authored-by: Kyle Ju <kyleju@chromium.org>
2023-03-14 11:45:06 -07:00
Jason Robbins fc0c4306e2
Change script to fill in all missing gates. (#2828) 2023-03-14 10:15:18 -07:00
Kyle Ju b399bcf3e4
Increase converters.py covarage (#2826)
Co-authored-by: Kyle Ju <kyleju@chromium.org>
2023-03-13 16:08:17 -07:00
Daniel Smith 8b6b888f71
Move legacy Feature helpers and converters to separate file (#2819)
* move legacy helpers and converters

* Move legacy tests to separate file
2023-03-13 15:07:55 -07:00
Jason Robbins 8c3326728f
Fix display of feature updated-on and refactor date rendering. (#2814) 2023-03-10 18:12:33 -08:00
Daniel Smith 218e2a8706
avoid notifier index out of bounds error (#2816) 2023-03-10 17:57:44 -08:00
Daniel Smith 5e60f64bc3
avoid index errors referencing ship stages (#2815) 2023-03-10 14:43:41 -08:00
Jason Robbins 74d3fb881c
Fix missing ctx var in a couple of places. (#2810) 2023-03-10 09:30:00 -08:00
Jason Robbins e4555b8056
Enable all gates and add reviewers. (#2806)
* Enable all gates and add reviewers.

* Update approval_defs.py

Add type annotation

* Update core_enums.py

There's no need for all the reviews when shipping something that is just a code change.
2023-03-09 14:07:55 -08:00
Yann Dago 61e6885473
Add Enterprise feature flow UI/UX changes (#2802)
* Hide edit button on feature page for enterprises
* After creating an enterprise feature go to the edit all page at the first rollout section
* Open all section on the feature page for enterprise by default
* Adding stage for enterprise features only adds rollout feature
* Remove the action of setting a stage in enterprise features
* Update scrolling behavior to scroll to the element from the hash if no form field is found
* Remove the edit icon from the feature page that navigates to the edit page
* Add an id to the "edit all" section headers to serve as an anchor for navigations
2023-03-09 16:18:20 -05:00
Daniel Smith b4e7ffd3ec
Remove legacy models from stars API and notifier (#2800) 2023-03-09 11:50:26 -08:00
Kyle Ju 6c84eca565
Increase channels_api test coverage to 100% (#2807)
Co-authored-by: Kyle Ju <kyleju@chromium.org>
2023-03-09 10:40:14 -08:00
Daniel LaLiberte b710351601
Fix hash link scrolling and focus for guide pages (#2804)
* Hacky implementation of scroll to anchor for editall page.

* Generalized a bit and added to stage page.

* Move common code to utils.js, cleanup.
2023-03-09 11:08:43 -05:00
Jason Robbins ff2ab3ab77
Add adoption fields to intent template. (#2805) 2023-03-08 17:08:49 -08:00
Jason Robbins faf3499262
Convert Adoption gate questionnaire into fields. (#2803) 2023-03-08 16:13:26 -08:00
dependabot[bot] 83c1791a89
npm: bump @shoelace-style/shoelace from 2.1.0 to 2.2.0 (#2795)
Bumps [@shoelace-style/shoelace](https://github.com/shoelace-style/shoelace) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/shoelace-style/shoelace/releases)
- [Commits](https://github.com/shoelace-style/shoelace/compare/v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: "@shoelace-style/shoelace"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-08 10:20:47 -08:00
dependabot[bot] b2dc9f790a
npm: bump eslint from 8.34.0 to 8.35.0 (#2794)
Bumps [eslint](https://github.com/eslint/eslint) from 8.34.0 to 8.35.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.34.0...v8.35.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-07 10:45:31 -08:00
dependabot[bot] fe03f1033b
npm: bump rollup from 3.17.2 to 3.18.0 (#2793)
Bumps [rollup](https://github.com/rollup/rollup) from 3.17.2 to 3.18.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v3.17.2...v3.18.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-07 10:45:00 -08:00