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

10516 Commits

Author SHA1 Message Date
Christopher Kolstad
32dd377c3e
fix: Use knex whereLike instead of whereRaw to fix escaping (#6041)
This escape with `??` double escaped the LIKE query causing no results.
This updates to using whereLike, which does the correct escaping for
string query.
2024-01-26 10:44:53 +01:00
Nuno Góis
32484460ef
chore: project actions table (#6039)
https://linear.app/unleash/issue/2-1877/ui-add-actions-table

Implements the new project actions table.


![image](https://github.com/Unleash/unleash/assets/14320932/2ce96669-4b8f-46cd-9a87-8b14f0682694)


![image](https://github.com/Unleash/unleash/assets/14320932/d73327f2-1e1a-4d57-8ef8-1f4518c4b5d9)


![image](https://github.com/Unleash/unleash/assets/14320932/27b9ffab-4fff-4fdf-808f-b778987fa198)
2024-01-26 08:20:30 +00:00
Tymoteusz Czech
00b3cbaa8b
Dashboard API hook (#5990)
Data fetching for dashboard

https://linear.app/unleash/issue/1-1969/dashboard-users-chart-api-hook
2024-01-26 09:03:12 +01:00
Fredrik Strand Oseberg
9ac1c88bd4
feat: new user widget (#6037)
Preliminary code for executive dashboard user widget
2024-01-25 14:43:59 +01:00
David Leek
c7f13aec0b
chore: implement created_by_user_id in features (#5994)
## About the changes

Adds a scheduled task that every 5 seconds updates 500 entries in the
features table setting `created_by_user_id`.
It does this by looking at the related event, checks created_by and
joins users table for match on username or email, and joins api_tokens
table on username matches. Then picks either a users id if set, or uses
-42 (admin token user)
2024-01-25 13:09:30 +01:00
Mateusz Kwasniewski
8ab4aa3d0e
feat: user trends migration (#6030) 2024-01-25 12:56:29 +01:00
David Leek
0045fcbcdf
chore: replace systemUser -1 with new -1337 system user (#5999)
## About the changes
This PR replaces the old systemUser -1 in user-service.ts with the new
SYSTEM_USER -1337 and adds a migration to move events created_by = -1 to
-1337


## Discussion points
Does it make sense to do both of these things? Or should we skip the
migration? How would this behave in a large system with hundreds of
thousands of events, should this be split up?
2024-01-25 11:19:39 +01:00
andreas-unleash
8f3275ee40
chore: change users image_url column to text (#6031)
Change the image_url column to text

Closes #
https://github.com/orgs/Unleash/projects/8/views/1?pane=issue&itemId=51021534

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-01-25 11:40:18 +02:00
andreas-unleash
89bea0d532
fix: clone variants (featureEnv and strategy) when cloning an env (#6026)
Fixes 2 bugs
- Strategy variants
- Feature env variants 
not being cloned when cloning an environment

Closes #
[SR-350](https://linear.app/unleash/issue/SR-350/cloning-environment-does-not-clone-variants-or-strategy-variants)

Manual test verifies the fix
<img width="1659" alt="Screenshot 2024-01-24 at 16 48 28"
src="https://github.com/Unleash/unleash/assets/104830839/ba9fc9b8-e792-47bb-b6e8-660350384ea8">
<img width="1408" alt="Screenshot 2024-01-24 at 16 48 10"
src="https://github.com/Unleash/unleash/assets/104830839/1e2d5287-35d0-42d2-9ab2-8caa313bd5a8">

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-01-25 10:53:43 +02:00
Mateusz Kwasniewski
41351a694e
refactor: Instance stats service composition root (#6029) 2024-01-25 09:11:26 +01:00
Jaanus Sellin
b0ecfd4d34
feat: add plausible change-requests-conflicts (#6024) 2024-01-24 21:46:08 +02:00
Nnenna Ndukwe
936fa44ec5
Shorter nav names for tutorials while maintaining SEO titles (#6028)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

Let's update our tutorial titles in the left navigation menu so it's
shorter and simpler.
This will _not_ change the metadata and doc titles when you click on
them. Only the label in the nav.

BEFORE
![Screenshot 2024-01-24 at 9 52
17 AM](https://github.com/Unleash/unleash/assets/22972707/283b22c5-c317-4140-8478-67965d004ef1)

AFTER
![Screenshot 2024-01-24 at 9 47
37 AM](https://github.com/Unleash/unleash/assets/22972707/04c58f24-1e1f-4f83-b1ff-1eeba670a092)


<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->
2024-01-24 10:14:50 -05:00
Christopher Kolstad
17d826ddf4
task: Add banner encouraging edge upgrade (#6018)
Only triggers if there is any rows in client instances that have

    sdk_version: unleash-edge with version < 17.0.0

The function that checks this memoizes the check for 10 minutes to avoid
scanning the client instances table too often.
2024-01-24 14:22:48 +00:00
Christopher Kolstad
3acdfc2cf4
task: Make /edge/metrics toggleable by toggle (#6003)
Previously we used a killswitch and returned 404 if the feature was
enabled. This flips that to a default disabled toggle, that has to be
turned on to handle old Edge (pre 17.0.0) posting bulk metrics
2024-01-24 14:09:03 +01:00
Nnenna Ndukwe
1f7c7940b4
Feature Flags with Python Tutorial (#6016)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

A new tutorial to get developers to implement feature flags into a
Python Flask app.
We have steps that guide them through the process using a simple
full-stack survey app.

Based off of a reviewed [Google Doc
here](https://docs.google.com/document/d/1YlG-TyQcMEyUrMjiWlYrd-J5DXog5ErbvSKAyuzKAnU/edit#heading=h.ryvmv14764i3)

The tutorial can go live in the docs nav in a new Python section, where
the Python examples will follow.


### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


`website/docs/feature-flag-tutorials/python/implementing-feature-flags.md`


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

---------

Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2024-01-24 08:00:33 -05:00
Jaanus Sellin
e4ca8a3e6c
feat: track search bar events (#6021)
Adding tracking for 2 views, when users use the new search. 

For features view and project view.
2024-01-24 14:23:23 +02:00
Nuno Góis
331033408c
fix: flag resolver get variant (#6020)
https://linear.app/unleash/issue/2-1880/fix-flag-resolver-getvariant-behavior

Fixes the flag resolver `getVariant` behavior when there's a variant
object set in `experimental` - The flag resolver should call the
external resolver `getVariant` when not overridden to be true, even if
set as variant object in `experimental`.

Related: https://github.com/Unleash/unleash/pull/3808
2024-01-24 11:53:04 +00:00
Gastón Fournier
cee2500a4d
feat(2-1879): add enabled to action sets (#6023)
## About the changes
Adds enabled to action sets table
2024-01-24 12:52:04 +01:00
Nuno Góis
5d1d428746
chore: project actions tab (#6009)
https://linear.app/unleash/issue/2-1858/add-new-actions-tab-to-project-settings

Adds the new actions tab to project settings, hidden behind the
`automatedActions` feature flag.


![image](https://github.com/Unleash/unleash/assets/14320932/594ed7e0-6e1a-464e-b649-bee368e14aea)
2024-01-24 10:05:04 +00:00
Maximilian Edison
e087f4226f
Docs: Getting Started Self-Hosting unleash (#6019)
## About the changes

put UNLEASH_DEFAULT_ADMIN_PASSWORD inside ``
2024-01-24 13:06:01 +04:00
Thomas Heartman
01318b11ea
fix: show the updated value instead of the snapshot value (#5989)
This PR fixes a bug in the displayed value of the conflict list so that
it shows the value it would update to instead of the snapshot value.

In doing so, it updates the logic of the algorithm to:

1. if the snapshot value and the current value are the same, it's not a
conflict (it's an intended change)
2. If the snapshot value differs from the current value, it is a
conflict if and only if the value in the change differs from the current
value. Otherwise, it's not a conflict.

The new test cases are:
- it shows a diff for a property if the snapshot and live version differ
for that property and the changed value is different from the live
version
- it does not show a diff for a property if the live version and the
change have the same value, even if the snapshot differs from the live
version
- it does not show a diff for a property if the snapshot and the live
version are the same
2024-01-24 12:39:41 +04:00
Nuno Góis
13a9b1bc13
fix: project settings title (#6011)
Small fix to the project settings title, correcting it and making it
consistent.
2024-01-24 08:38:13 +00:00
Mateusz Kwasniewski
e3fb3fd0be
fix: variant stickiness fix node client (#6017) 2024-01-24 09:28:06 +01:00
Nuno Góis
7413a1ee1a
chore: add support for project and environment in PermissionGuard (#6008)
I noticed some manual `hasAccess` usages in permission guards due to the
fact that `PermissionGuard` does not accept `project` and `environment`.
This PR adds this support to `PermissionGuard` so we can adapt these
`hasAccess` checks to use it instead, adding consistency and cleaning
things up.

This PR does not include these adaptations however, it only adds the
optional properties to the component. We can address these at a later
point.
2024-01-24 08:20:38 +00:00
Tymoteusz Czech
68eb3dec07
fix: upgrade unleash-client to v5.3.0 (#5800) 2024-01-24 09:12:07 +01:00
Ivar Conradi Østhus
3957abf0f6
docs: Minor typos (#6014)
Some minor typos in our docs.
2024-01-23 20:19:06 +01:00
Nicholas Haley
ab24264df9
docs: spelling and grammar (#6007)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->
This is a demo that uses [Floe](https://www.floe.dev/) to review the
`how-to` directory using the `spelling-and-grammar` rule.

You can read more about the tool here: https://www.floe.dev/docs
2024-01-23 19:52:10 +01:00
Mark Fulton
e9d49d68fd
Docs/license keys (#5959)
New docs page for the beta license keys feature introduced in Unleash
5.8 for self-hosted enterprise users.

---------

Co-authored-by: Ivar Conradi Østhus <ivar@getunleash.io>
2024-01-23 12:17:10 -05:00
Gastón Fournier
9f550331ce
chore: validate all tables have primary keys (#6005)
## About the changes
This is a helpful reminder to have primary keys in all our tables.

Related to [#4303](https://github.com/Unleash/unleash/issues/4303)
2024-01-23 16:38:16 +01:00
Gastón Fournier
82ac5a47ad
chore: This helps output the migrations being applied (#6004)
## About the changes
This outputs to console.log but should be indexable:

![image](https://github.com/Unleash/unleash/assets/455064/cb696936-7060-447d-b22d-ff62b4dbcbc3)
2024-01-23 16:01:36 +01:00
Mateusz Kwasniewski
156ba39b42
fix: strategy screen re-rendering table bug (#6006) 2024-01-23 15:49:13 +01:00
Christopher Kolstad
0515b424cd
docs: Added the new more fine-grained project permissions to the docs (#6000)
This adds documentation for the 8 new permissions added last week, in
preparation for including them in the 5.9.0 release.
Related
* https://github.com/Unleash/unleash/pull/5932
* https://github.com/Unleash/unleash/pull/5974
* https://github.com/ivarconr/unleash-enterprise/pull/1000

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2024-01-23 14:13:03 +01:00
andreas-unleash
cc5a4cbe33
fix: add unleash to default email sender string (#6002)
Adds "Unleash" to the "noreply@getunleash.io" for default email sender

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-01-23 14:32:40 +02:00
Gastón Fournier
db93ab57f0
chore: remove flagResolver option (#6001)
## About the changes
This option is not referenced in the code

I believe its original intent was to be able to override flagResolver,
but it's currently not being used:

a46f54f48a/src/lib/create-config.ts (L490-L491)

Instead, we're using `experimental`, `flags`, and `externalResolver`


a46f54f48a/src/lib/create-config.ts (L64-L73)


f63581c03a/src/lib/util/flag-resolver.ts (L12-L20)
2024-01-23 13:16:32 +01:00
Gastón Fournier
f63581c03a
fix: enabled lock check (#5997)
We should use the enhanced flagResolver
Tested locally:
```
9:44:13 AM - Starting compilation in watch mode...
[dev:backend] 
[dev:backend] 
[dev:backend] 9:44:26 AM - Found 0 errors. Watching for file changes.
[dev:backend] [2024-01-23T09:44:27.498] [INFO] server-impl.js - DB migration: start
[dev:backend] [2024-01-23T09:44:27.499] [INFO] server-impl.js - Running migration with lock
[dev:backend] [2024-01-23T09:44:29.884] [INFO] server-impl.js - DB migration: end
```
2024-01-23 10:46:48 +01:00
Mateusz Kwasniewski
48ef88b4fa
test: variant edit corner cases (#5998) 2024-01-23 10:38:31 +01:00
Gastón Fournier
0b1d565dad
chore: add logs (#5996)
Validate we're not using locks
2024-01-23 10:24:58 +01:00
Mateusz Kwasniewski
3fd735ac7e
fix: move useEffect before renders (#5995) 2024-01-23 09:32:48 +01:00
Mateusz Kwasniewski
5305c868e5
fix: update stickiness between tabs (#5991)
Fixes a bug where stickiness update to the main strategy would not propagate to strategy variants
2024-01-23 08:58:06 +01:00
Simon Prickett
8458619d82
Small typo fix. (#5993)
## About the changes

Fixed a small typo "Learnings Paths" -> "Learning Paths".
2024-01-23 11:21:45 +04:00
Nuno Góis
0847c2e52c
chore: add new action hooks (#5992)
https://linear.app/unleash/issue/2-1857/create-new-action-hooks-on-the-frontend

Adds action hooks to help us with CRUD operations on the frontend,
similar to https://github.com/Unleash/unleash/pull/5788 and
https://github.com/Unleash/unleash/pull/5790
2024-01-22 17:31:04 +00:00
Mark Fulton
b6a219dd36
docs/improve website README.md with local docs server installation step (#5956)
Minor addition to set correct local dir context in terminal when setting
up a local docs instance

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2024-01-22 09:44:31 -05:00
Christopher Kolstad
8256c2eaf2
task: Use fine-grained project permissions in frontend (#5974)
Connected to [#5932](https://github.com/Unleash/unleash/pull/5932) -
This starts using the new permissions in addition to the old
UPDATE_PROJECT permission. That way, if you're happy with
UPDATE_PROJECT, you don't need to change.

However, you can now add more fine grained permissions for both READ and
WRITE operations.
2024-01-22 15:34:10 +01:00
Tymoteusz Czech
b7483e8989
chore: generate frontend openapi types (#5988)
Update for dashboard types
2024-01-22 14:16:07 +01:00
Thomas Heartman
fd91cd1771
fix: don't use kebab-case for properties (#5979)
These are apparently unsupported in css objects and using the camelCased (or PascalCased) versions was the suggested fix.
2024-01-22 12:26:25 +00:00
Fredrik Strand Oseberg
60d2176efa
feat: add option to use variants with feedback (#5986)
This PR will allow us to use a feature flag with variants to control
whether or not we should show the comments field of the feedback form.
This will allow us to see whether we can increase feedback collection if
we reduce the load on the customer.
2024-01-22 13:14:27 +01:00
Gastón Fournier
c5afa8ff11
fix: unauthorized disable feature (#5982)
## About the changes
This was spotted while testing automated actions. Steps to reproduce:

1. Add an editor user
2. Get a PAT for the editor user
3. As Admin create a feature in a project where the editor user is not a
member and enable the feature
4. Try using the editor's PAT to modify the feature
5. As the editor create a project (you'd be made owner) and try the same
request but just change the project name for the new project just
created (don't change anything else)

**Expected behavior**: you can't disable the feature
**Actual behavior**: the feature is disabled

This does not happen when trying to turn on a flag because during the
turn-on process we do validate if the feature belongs to project when we
call updateStrategy:
c18a7c0dc2/src/lib/features/feature-toggle/feature-toggle-service.ts (L1751-L1764)
2024-01-22 12:50:14 +01:00
Mateusz Kwasniewski
055bab8e7c
feat: include number of flags chart (#5987) 2024-01-22 12:15:49 +01:00
Gastón Fournier
8ba5cdced1
feat: add action states (#5983)
## About the changes
Add action states table without an index yet
2024-01-22 11:49:35 +01:00
Mateusz Kwasniewski
c9b99f41cf
feat: number of flags component (#5984) 2024-01-22 11:47:15 +01:00