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

web: testing, storybooking, commenting, and documenting the simple things #9752

Draft
wants to merge 19 commits into
base: web/cleanup/admin-overview-testing
Choose a base branch
from

Conversation

kensternberg-authentik
Copy link
Contributor

web: Testing and documenting the simple things

Details

This commit adds unit tests for the Alerts and EmptyState elements. It includes a new test/documentation feature; elements can now be fully documented with text description and active controls.

It removes the babel imports entirely. Either we don’t need them, or the components that do need them are importing them automatically.

An outstanding bug in WebDriverIO unfortunately means that the tests cannot be run in parallel for the time being.While one test is running, the compiler for other tests becomes unreliable. They’re currently working on this issue. I have set the maxInstances to 1.

I have updated the <ak-alert> component just a bit, providing an attribute alternative to the Level property; now instead of passing it a <ak-alert level=${Levels.Warning}> properties, you can just say <ak-alert warning> and it’ll work just fine. The old way is still the default behavior.

The default behavior for EmptyState was a little confusing; I’ve re-arranged it for clarity. Since I touched it, I also added the interface and HTMLElementTagNameMap declarations.

Added documentation to all the elements I’ve touched (so far).

If changes to the frontend have been made

  • The code has been formatted (make web)
  • New interactivity has been documented in storybook
  • New components have been added to the test suite

dependabot bot and others added 7 commits May 16, 2024 12:22
Bumps the storybook group with 6 updates in the /web directory:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.0.10` | `8.1.1` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.0.10` | `8.1.1` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.0.10` | `8.1.1` |
| [@storybook/web-components](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/web-components) | `8.0.10` | `8.1.1` |
| [@storybook/web-components-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/web-components-vite) | `8.0.10` | `8.1.1` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.0.10` | `8.1.1` |



Updates `@storybook/addon-essentials` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/addons/essentials)

Updates `@storybook/addon-links` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/addons/links)

Updates `@storybook/blocks` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/ui/blocks)

Updates `@storybook/manager-api` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/lib/manager-api)

Updates `@storybook/web-components` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/renderers/web-components)

Updates `@storybook/web-components-vite` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/frameworks/web-components-vite)

Updates `storybook` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/web-components"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/web-components-vite"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.21.2 to 0.21.3.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.21.2...v0.21.3)

---
updated-dependencies:
- dependency-name: esbuild
  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>
Bumps the esbuild group in /web with 2 updates: [@esbuild/darwin-arm64](https://github.com/evanw/esbuild) and [@esbuild/linux-arm64](https://github.com/evanw/esbuild).


Updates `@esbuild/darwin-arm64` from 0.21.2 to 0.21.3
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.21.2...v0.21.3)

Updates `@esbuild/linux-arm64` from 0.21.2 to 0.21.3
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.21.2...v0.21.3)

---
updated-dependencies:
- dependency-name: "@esbuild/darwin-arm64"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: esbuild
- dependency-name: "@esbuild/linux-arm64"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: esbuild
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* main:
  root: include task_id in events and logs (#9749)
  web: bump the esbuild group in /web with 2 updates (#9745)
  web: bump esbuild from 0.21.2 to 0.21.3 in /web (#9746)
  web: bump the storybook group across 1 directory with 7 updates (#9747)
)

* new PR

* ken edits

* tweaks

---------

Co-authored-by: Tana M Berry <tana@goauthentik.com>
This commit adds unit tests for the Alerts and EmptyState elements. It includes a new
test/documentation feature; elements can now be fully documented with text description and active
controls.

It *removes* the `babel` imports entirely.  Either we don't need them, or the components that do
need them are importing them automatically.

[An outstanding bug in WebDriverIO](webdriverio/webdriverio#12056)
unfortunately means that the tests cannot be run in parallel for the time being.While one test is
running, the compiler for other tests becomes unreliable. They're currently working on this issue.
I have set the `maxInstances` to **1**.

I have updated the `<ak-alert>` component just a bit, providing an attribute alternative to the
`Level` property; now instead of passing it a `<ak-alert level=${Levels.Warning}>` properties, you
can just say `<ak-alert warning>` and it'll work just fine. The old way is still the default
behavior.

The default behavior for `EmptyState` was a little confusing; I've re-arranged it for clarity. Since
I touched it, I also added the `interface` and `HTMLElementTagNameMap` declarations.

Added documentation to all the elements I've touched (so far).
Copy link

netlify bot commented May 16, 2024

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 35f96df
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/664688c02783dd000818519e
😎 Deploy Preview https://deploy-preview-9752--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 16, 2024

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 22a8ccf
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/6647d3e91f6a900008ecd8f8
😎 Deploy Preview https://deploy-preview-9752--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kensternberg-authentik kensternberg-authentik changed the base branch from main to web/cleanup/admin-overview-testing May 16, 2024 22:29
Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (web/cleanup/admin-overview-testing@09803fe). Learn more about missing BASE report.

Current head 35f96df differs from pull request most recent head 22a8ccf

Please upload reports for the commit 22a8ccf to get more accurate results.

Additional details and impacted files
@@                          Coverage Diff                          @@
##             web/cleanup/admin-overview-testing    #9752   +/-   ##
=====================================================================
  Coverage                                      ?   92.38%           
=====================================================================
  Files                                         ?      704           
  Lines                                         ?    34403           
  Branches                                      ?        0           
=====================================================================
  Hits                                          ?    31784           
  Misses                                        ?     2619           
  Partials                                      ?        0           
Flag Coverage Δ
e2e 49.66% <50.00%> (?)
integration 25.36% <50.00%> (?)
unit 89.82% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-ghcr.io/goauthentik/dev-server:gh-35f96df66eae6cffcb20889750cd669227ffdd23
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

For arm64, use these values:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-ghcr.io/goauthentik/dev-server:gh-35f96df66eae6cffcb20889750cd669227ffdd23-arm64
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
    repository: ghcr.io/goauthentik/dev-server
    tag: gh-ghcr.io/goauthentik/dev-server:gh-35f96df66eae6cffcb20889750cd669227ffdd23

For arm64, use these values:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
    repository: ghcr.io/goauthentik/dev-server
    tag: gh-ghcr.io/goauthentik/dev-server:gh-35f96df66eae6cffcb20889750cd669227ffdd23-arm64

Afterwards, run the upgrade commands from the latest release notes.

dependabot bot and others added 11 commits May 17, 2024 12:17
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 124.0.3 to 125.0.0.
- [Commits](giggio/node-chromedriver@124.0.3...125.0.0)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  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>
Bumps [github.com/sethvargo/go-envconfig](https://github.com/sethvargo/go-envconfig) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/sethvargo/go-envconfig/releases)
- [Commits](sethvargo/go-envconfig@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: github.com/sethvargo/go-envconfig
  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>
Bumps [msgraph-sdk](https://github.com/microsoftgraph/msgraph-sdk-python) from 1.2.0 to 1.4.0.
- [Release notes](https://github.com/microsoftgraph/msgraph-sdk-python/releases)
- [Changelog](https://github.com/microsoftgraph/msgraph-sdk-python/blob/main/CHANGELOG.md)
- [Commits](microsoftgraph/msgraph-sdk-python@v1.2.0...v1.4.0)

---
updated-dependencies:
- dependency-name: msgraph-sdk
  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>
Bumps [selenium](https://github.com/SeleniumHQ/Selenium) from 4.20.0 to 4.21.0.
- [Release notes](https://github.com/SeleniumHQ/Selenium/releases)
- [Commits](SeleniumHQ/selenium@selenium-4.20.0...selenium-4.21.0)

---
updated-dependencies:
- dependency-name: selenium
  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>
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.1.1 to 2.2.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-python@2.1.1...2.2.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  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>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: rissson <18313093+rissson@users.noreply.github.com>
… group across 1 directory (#9757)

* web: bump @sentry/browser in /web in the sentry group across 1 directory

Bumps the sentry group with 1 update in the /web directory: [@sentry/browser](https://github.com/getsentry/sentry-javascript).


Updates `@sentry/browser` from 7.114.0 to 8.2.1
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](getsentry/sentry-javascript@7.114.0...8.2.1)

---
updated-dependencies:
- dependency-name: "@sentry/browser"
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: sentry
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix sentry beforeSend

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit documents and adds unit tests for our `Labels` component, which are usually called
"chips" in other design systems.

I've also reverted to allowing the components that take 'level' information to take it as a single
argument that is _either_ an attribute or a property.  If it's a property, it reverts to the older
behavior.
* main:
  web: bump @sentry/browser from 7.114.0 to 8.2.1 in /web in the sentry group across 1 directory (#9757)
  core, web: update translations (#9714)
  core: bump sentry-sdk from 2.1.1 to 2.2.0 (#9753)
  core: bump selenium from 4.20.0 to 4.21.0 (#9754)
  core: bump msgraph-sdk from 1.2.0 to 1.4.0 (#9755)
  core: bump github.com/sethvargo/go-envconfig from 1.0.1 to 1.0.2 (#9756)
  web: bump chromedriver from 124.0.3 to 125.0.0 in /tests/wdio (#9758)
  website/docs: new PR for the Entra provider docs (ignore old one) (#9741)
  root: include task_id in events and logs (#9749)
  web: bump the esbuild group in /web with 2 updates (#9745)
  web: bump esbuild from 0.21.2 to 0.21.3 in /web (#9746)
  web: bump the storybook group across 1 directory with 7 updates (#9747)
* dev:
  web: bump @sentry/browser from 7.114.0 to 8.2.1 in /web in the sentry group across 1 directory (#9757)
  core, web: update translations (#9714)
  core: bump sentry-sdk from 2.1.1 to 2.2.0 (#9753)
  core: bump selenium from 4.20.0 to 4.21.0 (#9754)
  core: bump msgraph-sdk from 1.2.0 to 1.4.0 (#9755)
  core: bump github.com/sethvargo/go-envconfig from 1.0.1 to 1.0.2 (#9756)
  web: bump chromedriver from 124.0.3 to 125.0.0 in /tests/wdio (#9758)
  website/docs: new PR for the Entra provider docs (ignore old one) (#9741)
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.

None yet

3 participants