1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
Commit Graph

1636 Commits

Author SHA1 Message Date
Mateusz Kwasniewski
7800d9d1b4
feat: export all features in project (#5677) 2023-12-19 08:57:10 +01:00
Nuno Góis
138d303da4
chore: rename secret to token in incoming_webhook_tokens (#5679)
Renames `secret` to `token` in `incoming_webhook_tokens` for
consistency. This table is not being used yet, so this should be a very
safe change.
2023-12-18 17:11:59 +00:00
Nuno Góis
5f975bbad7
chore: incoming webhooks and tokens migration (#5670)
https://linear.app/unleash/issue/2-1699/db-create-migration-for-a-new-incoming-webhooks-table

Adds a migration that creates 2 tables:
 - `incoming_webhooks`
 - `incoming_webhook_tokens`
2023-12-18 13:22:28 +00:00
Jaanus Sellin
d0facc7101
fix: adjust page limit normalization (#5672) 2023-12-18 14:33:45 +02:00
Jaanus Sellin
3b635132f9
feat: enable sorting by project (#5671) 2023-12-18 14:33:38 +02:00
Jaanus Sellin
4af0abc6c2
fix: increase page size in backend to 100 (#5669) 2023-12-18 14:18:05 +02:00
Nuno Góis
00ed539c19
Revert "chore: incoming webhooks and tokens migration"
This reverts commit 695474576e.
2023-12-18 11:47:04 +00:00
Nuno Góis
695474576e
chore: incoming webhooks and tokens migration 2023-12-18 11:44:29 +00:00
Jaanus Sellin
f4268347da
fix: last seen now sorts nulls last (#5664)
Two changes were needed to sort better

1. Since we are still using `last seen` from `features` table for
backwards compatibility, we needed to add it to sort condition.
2. Nulls break the order, so now sorting nulls as last.
2023-12-18 10:36:50 +02:00
Thomas Heartman
ab2281d7e7
fix: make username nullable in user-schema (#5656)
I noticed I was getting warnings logged in my local instance when
visiting the users page (`/admin/users`)

```json
{
    "schema": "#/components/schemas/publicSignupTokensSchema",
    "errors": [
        {
            "instancePath": "/tokens/0/users/0/username",
            "schemaPath": "#/components/schemas/userSchema/properties/username/type",
            "keyword": "type",
            "params": {
                "type": "string"
            },
            "message": "must be string"
        }
    ]
}
```

It was complaining because one of my users doesn't have a username, so
the value returned from the API was:

```json
{
    "users": [
        {
            "id": 2,
            "name": "2mas",
            "username": null
        }
    ]
}
```

This adjustment fixes that oversight by allowing `null` values for the
username.
2023-12-16 08:28:22 +01:00
Pedro Papadopolis
24c2a70138
feat: Make compression middleware optional (#5306)
## Why
Currently AWS API Gateway doesn't have compression enabled by default,
this PR will make it easier to for example deploy Unleash over to AWS
Lambda without further configuration in API Gateway, frameworks like
Serverless requires a bit more work to set up compression and some times
one might not need compression at all.

## How
Create a new config flag called `disableCompression` which will not
include `compression` middleware in express' instance when set as true.
2023-12-16 08:06:26 +01:00
Jaanus Sellin
dafec2e672
fix: reducing of features will not break order anymore (#5654) 2023-12-15 14:46:40 +02:00
Mateusz Kwasniewski
8283edfc0a
feat: Sort by stale (#5653) 2023-12-15 11:56:06 +00:00
Nuno Góis
8be09510e8
chore: clean up banners feature flag (#5648)
Cleans up some leftover references to the `banners` feature flag. 

Related to https://github.com/Unleash/unleash/pull/5348
2023-12-15 10:16:13 +00:00
Nuno Góis
f84fa81ebe
chore: add incomingWebhooks feature flag (#5647)
https://linear.app/unleash/issue/2-1683/feature-flag-add-a-new-incomingwebhooks-feature-flag-for-this-feature

Adds a new `incomingWebhooks` feature flag.
2023-12-15 10:15:52 +00:00
Gastón Fournier
1338496445
chore: enable manual testing of migrations (#5645)
## About the changes
This adds a Makefile to make it easy to test migrations from one version
of Unleash to another.

The script depends on [docker compose
V2](https://docs.docker.com/compose/migrate/)

**Before starting**: make sure you're inside test-migrations folder and
run `make clean` to be in a clean state.

We can run 2 versions of Unleash side by side with a shared database
(the second version will apply migrations to the DB):
```shell
UNLEASH_DOCKER_IMAGE=unleashorg/unleash-server:5.6.10 make start-unleash # defaults to port 4242
UNLEASH_DOCKER_IMAGE=unleashorg/unleash-server:latest make start-another-unleash # defaults to port 4243
make test # run basic UI tests against port 4242 (first image)
EXPOSED_PORT=4243 make test # run basic UI tests against port 4243
```

This also enables us to test our local repository with our code of
Unleash server running at port 4244 (`EXPOSE_PORT=4444 make run-current`
if you want to change it):
```shell
UNLEASH_DOCKER_IMAGE=unleashorg/unleash-server:5.6.10 make start-unleash # defaults to port 4242
make run-current # exposes the current backend at 4244
```

You can also connect the latest UI to any of the ports specified above,
starting the UI at port 3000:
```shell
EXPOSED_PORT=4242 make run-current-ui # exposed port defaults to 4244 which is the port of the current backend
```
2023-12-14 15:12:13 +01:00
Jaanus Sellin
fa087fb473
refactor: move search implementation out of strategies store (#5642)
This is first step of refactoring. Next steps follow with possibly a
query builder, or atleast using some reusable methods.
2023-12-14 15:45:36 +02:00
Jaanus Sellin
fbb5dd9022
feat: add icons to filters (#5640) 2023-12-14 15:06:26 +02:00
Christopher Kolstad
bfa82d79bf
feat: adds created_by_user_id to all events (#5619)
### What
Adds `createdByUserId` to all events exposed by unleash. In addition
this PR updates all tests and usages of the methods in this codebase to
include the required number.
2023-12-14 13:45:25 +01:00
Ivar Conradi Østhus
e6442d9304
fix: frontend api should use cache-control strategy 'no-cache' (#5641) 2023-12-14 10:35:21 +01:00
Ivar Conradi Østhus
4618a52014
fix: optimize cores headers (#5629)
This commit enhances two aspects of CORS:

- Always support CORS preflight requests.
- Do not add additional secuity headers for prefligh calls.
2023-12-13 16:12:17 +01:00
andreas-unleash
6c52158723
feat: add reason column to change_request_schedule (#5631)
What it says on the tin.

Closes: #
[1-1766](https://linear.app/unleash/issue/1-1766/add-reason-column-to-change-request-schedule)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-12-13 14:07:02 +02:00
David Leek
d632690203
chore: add created by user id to events (#5621)
## About the changes

Adds the column `created_by_user_id` to `events` table and adds index
for it

---------

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2023-12-12 15:57:59 +01:00
Thomas Heartman
8e430810ef
fix: return 400 on invalid POST data to project access endpoint (#5610)
This PR fixes the issue discussed in SR-234, where you would get a 200
OK response even if your POST request to
`/api/admin/projects/<project-name>/access` contains invalid data (and
nothing is persisted).
2023-12-12 14:46:23 +01:00
Gard Rimestad
d6afe80bab
feat: datadog integration - link to valid source type names (#5608)
Datadog only supports know source_type_names, lets make that easy to
figure out for the user.
2023-12-12 14:37:41 +01:00
Ivar Conradi Østhus
43c563af57
fix: optimize headers we return for API calls. (#5607)
Today we include a lot of "secutiry headers" for all API calls. Quite a
lot of them are only relevent when we return a HTML document for the
browser.

This PR removes and simplify these headers for API calls, so that we do
not include unecessary data in the HTTP headers.

Each header have been carfully examied by following best practices from
these source:

-
https://cheatsheetseries.owasp.org/cheatsheets/REST_Security_Cheat_Sheet.html
- https://owasp.org/www-project-secure-headers/

This feature is protected with feature flag named 'stripHeadersOnAPI'.
2023-12-12 10:20:28 +01:00
Ivar Conradi Østhus
abf540a1cc
fix: add 'Vary: Origin' header to cors response 2023-12-12 08:05:43 +01:00
Christopher Kolstad
18ea7349c6
feat: add created_by to api_tokens table (#5596)
Adds a migration for adding created_by column to the api_tokens table.
2023-12-11 15:41:36 +01:00
Christopher Kolstad
150e6b03dc
feat: add column created_by to roles table (#5595)
Tracking who creates roles
2023-12-11 15:40:17 +01:00
Christopher Kolstad
4f7b3aa759
feat: add column created_by to role_user table (#5594)
As it says in the title. Adds a created_by column to the role_user table
to more easily track who's doing what.
2023-12-11 15:40:02 +01:00
Christopher Kolstad
0f250ba06c
feat: add created_by to role_permission table (#5592)
As it says on the tin. In an attempt to make all operations in Unleash
traceable to an originator. This PR adds created_by to role_permission,
which will show which user assigned a permission to a role.
2023-12-11 15:39:44 +01:00
Christopher Kolstad
ed220c0b89
feat: add column created_by to users table (#5597) 2023-12-11 15:39:07 +01:00
David Leek
5b6a26a828
chore: migration for features created by (#5593)
Contains the migration that adds the column created_by to `features`
2023-12-11 14:58:23 +01:00
David Leek
427abbd8d1
chore: add migration for adding created_by to feature_types table (#5591)
Contains the migration that adds the column created_by to
`feature_types`
2023-12-11 14:57:58 +01:00
David Leek
0f1b89b259
chore: add migration for adding created_by to feature_tag table (#5590)
## About the changes

Contains the migration that adds the column created_by to `feature_tag`
2023-12-11 14:57:40 +01:00
David Leek
27732274a3
chore: add migration for adding created_by to feature_strategies table (#5589)
## About the changes

Contains the migration that adds the column created_by to
`feature_strategies`
2023-12-11 14:57:18 +01:00
Jaanus Sellin
e8f19e6341
fix: added stronger tag validations (#5585)
Now it is impossible to filter based on invalid tag syntax.
2023-12-11 13:34:51 +02:00
Fredrik Strand Oseberg
ec670450fd
feat: initial setup (#5583)
This PR sets up the feature flag for the new strategy configuration and
duplicates the components for the new setup
2023-12-11 12:23:18 +01:00
andreas-unleash
2322e1149a
feat: more info on staleness in health report (#5582)
Adds an info tooltip for potentially stale and a link to configure
feature toggle type lifetime


Closes
[UNL-215](https://linear.app/unleash/issue/UNL-215/improve-health-page-with-some-guidance-about-staleness)
<img width="1323" alt="Screenshot 2023-12-11 at 11 39 36"
src="https://github.com/Unleash/unleash/assets/104830839/386ec6e6-55df-42ca-b5e0-ef3e75448452">

<img width="1316" alt="Screenshot 2023-12-11 at 11 43 07"
src="https://github.com/Unleash/unleash/assets/104830839/5bf7df15-ff87-4ce0-be25-0c031c881d05">

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-12-11 13:11:28 +02:00
Thomas Heartman
fb5a487663
feat: add schema for change request strategies (#5578)
This change adds a property to the segmentStrategiesSchema to make sure
that change request strategies are listed in the openapi spec

It also renames the files that contains that schema and its tests from
`admin-strategies-schema` to `segment-strategies-schema`.
2023-12-11 11:01:47 +00:00
Ivar Conradi Østhus
9508c79451
fix: remove secure headers on local dev 2023-12-08 19:51:12 +01:00
Jaanus Sellin
166432bcb0
feat: support localization in date filter (#5572) 2023-12-08 13:20:39 +02:00
Ivar Conradi Østhus
b6f1929efb
Poc/strip client headers on 304 (#5574)
To reduce traffic returned on 304.
2023-12-08 12:14:37 +01:00
Jaanus Sellin
1173b664da
feat: add created date filter component (#5569) 2023-12-08 10:07:57 +02:00
Jaanus Sellin
d9648de08d
chore: rename is not any of to is none of (#5544) 2023-12-06 12:53:51 +02:00
andreas-unleash
12f79f90bb
feat: Scheduled change conflict email templates and function (#5547)
Creates a new email template for scheduled change conflicts and a
function to send it.

Relates to:
#[1-1686](https://linear.app/unleash/issue/1-1686/send-an-email-when-the-conflicts-are-detected)


![Screenshot 2023-12-05 at 16 55
51](https://github.com/Unleash/unleash/assets/104830839/4d37527e-bb83-4ac5-9437-09b6ab08c979)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2023-12-06 11:57:19 +02:00
Mateusz Kwasniewski
2dcf4af7b1
feat: filter persisted in url (#5549) 2023-12-05 17:31:23 +01:00
Jaanus Sellin
6f497e6708
feat: add openapi validation for search (#5541) 2023-12-05 11:25:56 +02:00
Jaanus Sellin
d1984b2447
feat: validate date filter and add more tests (#5525) 2023-12-04 15:41:05 +02:00
andreas-unleash
3056456770
fix: scheduled cr failed email (#5522)
Relates to #
[1-1687](https://linear.app/unleash/issue/1-1687/send-an-email-when-the-scheduling-fails)

Removed `name` - not in template
Added missed `changeRequestTitle` for the html template context

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-12-04 11:51:06 +02:00