90 Commits

Author SHA1 Message Date
ian
7899f6a267 Remove dev dependencies when running blackbox tests (#16271)
* Remove dev dependencies when running blackbox tests

* Install dev dependencies in workspace root to run tests

* Shift dependency to see if tests fail

* Revert dependency shifting test

* Remove specifying of shell
2022-11-03 09:15:48 -04:00
Pascal Jufer
f5c564ddfd Fix "Create release" job (#16261) 2022-11-01 21:11:51 -04:00
Roger Stringer
53a3194d5c Add support for SAML Part 2 (#16145)
* new saml branch

* put saml info back in

* put saml info back in

* clean up code

* validate saml config

* validate schema

* Add saml auth flow tests

* use RelayState for redirects

* Update tests for RelayState

* Fix linting

* remove validateMeta as samlify does it already

* Fix linting

* change catch on login

* Update api/src/auth/drivers/saml.ts

Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>

* remove login since not needed here

* clear cookie if set on logout

* empty login method

* invalidate logout in db

* if relayState and login failed, redirect back with a reason

* Cleanup linter warnings

* Remove range from packages

* Opinions opinions opinions opinions

Just a couple personal opinion cleanup pieces

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-11-01 22:09:31 +00:00
Pascal Jufer
92466dd2a9 Replace depreacted "create-release" action (#16144)
* Replace depreacted "create-release" action

* Fix indentation

* Target is not required as the tag will already exist

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-24 12:26:47 -04:00
Pascal Jufer
5507ca3f41 Fix path for packages in package.json used for Docker image (#16141)
* Use basename to get relative path for packages

* Revert "Revert "Small `Release` workflow clean-up (#16083)" (#16120)"

This reverts commit c2ee8c24ef.
2022-10-24 09:47:03 -04:00
Rijk van Zanten
c2ee8c24ef Revert "Small Release workflow clean-up (#16083)" (#16120)
This reverts commit dbfedb56fe.
2022-10-22 13:05:22 -04:00
Pascal Jufer
dbfedb56fe Small Release workflow clean-up (#16083)
* Consistent usage of `if` statements

Brackets are not required in `if` statements, see https://docs.github.com/en/actions/learn-github-actions/expressions#about-expressions

* Use prepare action to setup pnpm in publish-npm job
2022-10-20 12:34:19 -04:00
ian
98daa7dbac Update upload-artifact action to v3 (#16081) 2022-10-20 11:29:53 -04:00
ian
83b6027cc3 Run blackbox tests in parallel (#16048)
* Run blackbox tests in parallel

* Add slight delay for updates in timezone tests

* Revert trigger on PR
2022-10-19 10:04:32 -04:00
ian
6cdd0eead4 Fix CodeQL threadflow steps (#15873)
* Upload SARIF artifact

* Test removal of empty object

* Fix polynomial-redos

* Revert fail-fast change

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-12 16:01:13 -04:00
ian
4bcf601524 Run blackbox tests when shared package / workflow is updated (#14954) 2022-08-08 13:52:27 -04:00
Pascal Jufer
3e8d965642 Clean-up GitHub workflows (#14945)
* Clean-up GitHub workflows

* Remove checkout step from 'prepare' action instead
2022-08-08 10:34:39 -04:00
Pascal Jufer
29619f723b Use native concurrency option to cancel outdated workflow runs (#14943) 2022-08-08 10:16:43 -04:00
Azri Kahar
333badc344 Tweak add-to-project GitHub action (#14934)
* ignore crowdin updates PRs

* update version

* out of beta!
2022-08-08 09:56:18 -04:00
rijkvanzanten
3d03291c31 Rerun workflow on workflow change 2022-07-21 16:23:36 -04:00
rijkvanzanten
2910ee286b Try with pnpm 2022-07-21 16:22:16 -04:00
rijkvanzanten
9833294743 Oracle (╯°□°)╯︵ ┻━┻ 2022-07-21 16:03:30 -04:00
rijkvanzanten
54f80376c8 Don't cache npm in node checkout 2022-07-21 15:30:26 -04:00
ian
9d738d12ce Fix incorrect cancel workflow version (#14533) 2022-07-20 13:05:43 -04:00
ian
bcb33a798b Cancel all previous workflows in the branch (#14525) 2022-07-20 10:42:14 -04:00
ian
3770661bde Run blackbox tests when updated (#14484)
* Run blackbox tests when updated

* Run tests when dependencies are updated
2022-07-18 11:55:33 -04:00
Rijk van Zanten
27cc3e1bec Move repo to pnpm based workflow (#14350)
* Use pnpm instead of npm

* Setup workspace

* Replace scripts / lerna root stuff

* Add todo file

* Update lock, start updating packages

* Update todo

* [WIP] Keep going on module resolution in pnpm

* Fix final missing deps/types for complete build

* [WIP] Replace npm commands with pnpm alternatives

* Update jest config for v28

* Fix missing package under schema

* Update workflow

* Run CI on fork

* Use local reference

* Remove version from local workflow

* Add build to prepare

* Add Node's max old space size flag to linter

* Idemdito for codeql

* Hyphens? Underscores?

* Bang

* Only build one thing at a time

* Underscores after all?

* Match 7gb of GH

* Set env on prepare

* Jest is driving me nuts

* Downgrade jest

* Add root jest

* We'll get there, eventually.

* 🥳

* Het houdt niet op, niet vanzelf

* attempt to fix e2e

* fix unit test & shared import

* add `debug: true` to CodeQL action

* Fix dev call in shared

* Add missing cross-env

* Add missing geo-json dependency for app

* add flag to prepare action to skip build

* remove debug flag from codeql action

* fix invalid env syntax

* add tslib to app dependencies for tests

* another attempt

* Added missing rimraf dependency for the api prebuild/cleanup scripts

* Added missing ts-node dependency for the api cli script

* update E2E tests readme to use pnpm

* Undo move of extensions sdk

* Fixes nested groups in accordions not rendering fields (#14369)

* initial fix for nested groups in accordions

* removed debug code

* Fix strict relative dates showing "incorrect" (#14390)

* Set rounding method of relative formatted date to floor when strict option is selected

* Add round fn as an option

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>

* Don't use locales in generated camelCased values from env (#14401)

Ref https://github.com/directus/directus/discussions/14122

* Fix list panel descending sort (#14396)

* fix list panel descending sort

* Handle missing or explicit desc value

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>

* Fix query primary field for system tables (#14402)

* New Crowdin updates (#14403)

* Update source file en-US.yaml

* New translations en-US.yaml (Spanish, Chile)

* New translations en-US.yaml (Spanish, Latin America)

* New translations en-US.yaml (Greek)

* New translations en-US.yaml (Italian)

* New translations en-US.yaml (French, Canada)

* Fix/wysiwyg context menu (#14404)

* New translations en-US.yaml (Polish) (#14407)

* Encoded the url using encodeURIComponent, so that the url gets sanitzed and so, we did not get 404 error. (#14418)

* Encoded the url using encodeURIComponent, so that the url gets sanitized and we did not get 404 error.

* Added required changes as stated by the reviewer

* Used encodeURI instead of encodeURIComponent to encode the params only

* Solved linting error

* Solved linting errors

* checked with npm run lint, no linting errors found

* fix generateJoi error due to empty permissions when creating new role (#14416)

* fix empty permissions when creating new role

* basic test

* move logic up

* additional test

* Update api/tests/utils/filter-items.test.ts

Co-authored-by: ian <licitdev@gmail.com>

Co-authored-by: ian <licitdev@gmail.com>

* Recreate lockfile

* Fix build of extensions-sdk

* Add missing dependency

* Add some more missing deps

* Update blackbox to use pnpm

* Update workflow to use main

* Update pack to work with pnpm

* Simplify commands

* Remove todo file (completed)

* ADd missing types dep

* Use local test version

* Remove version from local reference

* Call super with context

* Add missing dep

* Simplify workflows

Ref https://github.com/directus/organization/issues/135

* Simplify some more

* Linter is on root

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: brainslug <tim@brainslug.nl>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Gerard Lamusse <gerardlamo@gmail.com>
Co-authored-by: José Varela <joselcvarela@gmail.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Zeel Pathak <60271095+zeel-pathak@users.noreply.github.com>
2022-07-15 17:41:49 -04:00
ian
c691c4c7b2 Switch blackbox tests workflow target to core repo (#14461) 2022-07-15 13:19:59 -04:00
ian
8d1966ab04 Blackbox testing (#13200)
* Add black box tests

* Revert docker compose file

* Update workflow

* Try use workflow from dev repo

* Increase seedDB() timeout

* Disable other checks for now

* Change DB sequence

* Update jest moduleNameMapper

* Update workflow's docker-compose.yml path

* Slice array first

* Remove differentiation of status code

* Delete field only after foreign key constraints are removed

* Add checks for different types of primary key

* Test global query filter for all field types

* Increase timeout for m2o seeding

* Add case insensitive string operators

* Update filter check to run on relational fields

* Enable time field checks

* Add seeded random and fix relational seeding

* Add casting for integer and bigInteger

* Minor fixes

* Reduce bigInt values

* Separate seeding of DB structure from values

* Add primaryKey seeding function

* Use automatic IDs except for string pk

* Try fix ci

* Update package-lock.json

* Update common.test for concealed user tokens

* Use dynamic field type for m2o.test relational fields

* Temporary disable missing nicontains for string type

* Add support for alias type filtering

* Fix relational filter operator checks

* Add initial o2m test

* Remove integer pk limit

* Add empty checks for string and uuid null

* Limit generated integer value to 4 bytes

* Patch timezone tests for MSSQL

* Remove sample query filter test

* Fix timezone test for sqlite

* Fix MSSQL uuids

* Fix MSSQL timestamp inaccuracy

* Cast datetime schema to milliseconds for comparison

* Fix MySQL / Maria timestamp inaccuracy

* Fix MySQL / Maria between operator inconsistency for float type

* Fix missing time datatype in Oracle

* Skip filter testing on Oracle

* Enable o2m filter tests for other collections

* Run tests only on SQLite for PRs unless the Full Tests label exists

* Try fix actions

* Refactor github actions

* Update tests flow setup to use getURL()

* Start postgres docker

* Reinstate package-lock

* Fix geometry test

* Remove .gitkeep files

* Add todo.md

* Rename black box to blackbox

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-07-15 15:25:32 +00:00
Rijk van Zanten
c059f7c219 Upgrade codeql to v2 (#13876)
https://github.blog/changelog/2022-04-27-code-scanning-deprecation-of-codeql-action-v1/
2022-06-13 16:46:13 -04:00
rijkvanzanten
4d63fba50a Increase node mem allocation in release flow
Should fix the build issue where rollup runs out of memory when building the app
2022-06-03 10:33:52 -04:00
Jay Cammarano
4e5fbf1b0c Use pull_request_target instead of pull_request for auto-project-assign (#13648)
* Changes the token to fallback to github.token

* pull_request_target

* Update .github/workflows/add-to-project.yml

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2022-06-01 14:04:53 -04:00
Jay Cammarano
1d5a32c5d6 add to project (#13581) 2022-05-26 14:13:34 -04:00
Nicola Krumschmidt
ed97f8bf97 Remove workaround in release flow (#13455)
This forces the release workflow to use `node@16.15` which includes `npm@8.5`.
2022-05-25 12:22:27 -04:00
Rijk van Zanten
eea9f45624 Add authenticate hook to implement custom auth checks against current request (#11942)
* Add "authenticate" filter hook that allows custom auth check

* Start on test

* Update Jest, restructure API tests, start implementing authenticate test

* Move access token verify to util function

* Ensure jest can show inline warnings on correct lines

* Update is-directus-jwt to use jsonwebtoken decode + add tests

* Remove unused package

* Tweak and finish + test authenticate

* Tweak test

* Add authenticate filter to docs

* Don't scan tests for codeql

* No seriously, ignore tests
2022-03-03 16:29:13 -05:00
Nicola Krumschmidt
aa5da81fc0 Remove no-break space characters with regular spaces (#11232)
There are quite a few other occurrences all over the translation files,
some of which feel intentionally placed.
2022-01-24 09:43:57 -05:00
rijkvanzanten
47792f5b73 Use correct branch 2022-01-19 13:01:05 -05:00
Oreille
9dda9caddb Enable end-to-end tests for Oracle and SQLite (#11094)
* Enable end-to-end tests for Oracle and SQLite

* Add Oracle back to allVendors

* Use yum

* Use dnf

* Actually use yum

* Actually use dnf

* Actually use yum

* Try again

* Try manual install

* Fix env declaration

* Bump knex version (because https://github.com/knex/knex/issues/4844)

* Set max pool size for Oracle

* Add awaitDatabaseConnection

* Cache install and build step

* Run different tests sequentially

* Fix workflow name

* Show test results

* Fix names

* Fix success check

* Fix outputs

* Add oracle driver install

* Fix env

* Revert to previous structure to benchmark performance

* Only build specs and drive packages for unit tests

* Don't install everything to run linters

* Use this branch

* Fix missing lint dep

* Revert "Don't install everything to run linters", also build shared package

* Skip app build for tests

* Don't serve app for e2e tests

* Change time fields to timestamp becaues of inconsistencies between vendors

* Make npm ci faster

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-01-19 13:00:44 -05:00
Pascal Jufer
3ef0175df7 Make skipping of workflows work again (#11081) 2022-01-17 13:42:28 -05:00
Oreille
7e10d2017e End-to-end tests refactor (#10968)
* Refactor e2e tests

* Only install root dependencies for lint step

* Fix dumbest error ever

* Pass process.env too to spawned subprocess

* Suppress npm package installation prompt

* Improve error handling

* Add new compose file for tests

* Avoid port conflict with remoted

* Update docker-compose.yml

* Add test docs

* Use current branch workflow files and simplify skips

* Fix workflow file

* Fix workflow file

* Try adding `.yml` extension to allow reference in `uses`

* Place workflow file in folders to allow reference in `uses`

* Requires more work than expected, reverting

* Update docs to use correct compose file

* Remove comment / unused code

* Run tests from main

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Jay Cammarano <jay.cammarano@gmail.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-01-13 16:32:45 -05:00
Jay Cammarano
00a838f020 Docs for testing the API (#10275)
* mock-knex

* test on the migrations run started.

* test passing for run.up()

* reorganize /tests/ to allow integration tests

* e2e setup changes

* e2e jest.config moved

* e2e paths fixed, integration config

* add nonadmin role and user seed+migration

* auth/login w/ documentation (docs will be moved)

* update user seed

* add postgres10 to the ci?

* argon2 saves the day

* items tests passing with postgres10 support

* removed comments

* move generateHash out of directus_users

Co-authored-by: Jay Cammarano <jaycammarano@gmail.com>
2021-12-10 14:58:51 -05:00
Pascal Jufer
76a306e7f4 Run end-to-end tests only if corresponding files have been modified (#10135) 2021-11-29 15:04:42 +00:00
Rijk van Zanten
8d87302f01 Delete assign-author-to-pr.yml
Moving forwards, assignee will be treated as the person responsible for getting the PR merged in. This won't always be the original author.
2021-11-26 18:01:28 -05:00
Pascal Jufer
6fbbcff0ee Enable E2E Tests on PRs (#9762) 2021-11-12 10:40:53 -05:00
Pascal Jufer
9bbfdec611 No 'latest' Docker tag for pre-releases anymore (#9512) 2021-11-09 09:42:15 -05:00
Pascal Jufer
1514b878fa Enhance comments in CI workflow (#9408) 2021-11-03 11:10:00 -04:00
Pascal Jufer
b9aa6a491b Switch back to fkirc/skip-duplicate-actions (#9312)
All changes have been merged in
2021-11-01 12:39:06 -04:00
Pascal Jufer
64fa364ea6 Rearrange on events in e2e workflow (#9308) 2021-11-01 11:16:50 -04:00
Pascal Jufer
6994bba791 Revise GitHub workflows #2 (#9240)
* GitHub workflow revision #2

* Add a few comments

* Add and fix comments

* Move kodiak config into .github

To not overflow the root directory

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-11-01 11:05:13 -04:00
Jay Cammarano
ded3d4b141 workflow-dispatch added to e2e-tests.yml (#9265) 2021-10-30 17:11:36 -04:00
Pascal Jufer
3ba5c5935d Wait for checks before auto-merge Crowdin updates (#9156) 2021-10-26 09:48:45 -04:00
Pascal Jufer
ae1987a359 Revise GitHub workflows (#9011)
* Fix check for changed files & reformat workflows

* Test performance of paths-filter action

* Revise workflows

* Better wording

* Fix naming of "Pre-Check"

* Point out values

* Abreviate to make it look cleaner in report
2021-10-25 11:22:06 -04:00
Pascal Jufer
88813a59d3 Add GitHub Action to Auto-Merge Translations from Crowdin (#8966)
* Add Action to Auto-Merge Translations from Crowdin

* Don't trigger checks on translation updates
2021-10-20 11:01:14 -04:00
Tien Tran
b3f1e3383e Skip publish-npm job in the release workflow for forked repos (#8957) 2021-10-20 09:48:08 -04:00
Jay Cammarano
4794c103b1 disable sqlite in e2e tests on CI (#8774) 2021-10-13 22:12:10 +00:00