Skip to content

Commit 459cbf8

Browse files
Merge remote-tracking branch 'origin/main' into remove-feature-service-v2
2 parents 0442bc3 + ffb17d4 commit 459cbf8

File tree

72 files changed

+590
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+590
-337
lines changed

.github/workflows/check_links.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
restore-keys: cache-lychee-
2525
- name: Link Checker
2626
id: lychee
27-
uses: lycheeverse/lychee-action@v1.10.0
27+
uses: lycheeverse/lychee-action@v2.3.0
2828
with:
2929
fail: true
3030
args: '"./website/docs/**/*.md" "./website/docs/**/*.mdx" "./src/mailtemplates/*.mustache" --scheme http --scheme https --cache --max-cache-age 7d --exclude-mail --verbose' # other excludes are in .lycheeignore

.github/workflows/generate-docs.yaml

-35
This file was deleted.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Unleash is the most popular open-source solution for feature flagging on GitHub.
2727

2828
### Set up Unleash
2929

30-
To get started with Unleash, you can either explore [Unleash Enterprise](#set-up-unleash-enterprise) with a free trial or [get started locally](#set-up-unleash-locally) with our open-source solution.
30+
To get started with Unleash, you can either explore [Unleash Enterprise](#unleash-enterprise) with a free trial or [get started locally](#unleash-open-source) with our open-source solution.
3131

3232
#### Unleash Enterprise
3333

@@ -137,7 +137,7 @@ Check out [the CONTRIBUTING.md file](./CONTRIBUTING.md) for contribution guideli
137137

138138
- Get an overview of all feature flags across all your environments, applications and services
139139
- Targeted releases using [activation strategies](https://docs.getunleash.io/reference/activation-strategies) to enable and disable features for certain users or segments without having to redeploy your application.
140-
- [Canary releases / gradual rollouts](https://docs.getunleash.io/reference/activation-strategies#gradual-rollout)
140+
- [Canary releases / gradual rollouts](https://docs.getunleash.io/reference/activation-strategies)
141141
- [Kill switches](https://docs.getunleash.io/reference/feature-toggles#feature-flag-types)
142142
- [A/B testing](https://docs.getunleash.io/feature-flag-tutorials/use-cases/a-b-testing)
143143
- 2 [environments](https://docs.getunleash.io/reference/environments)

frontend/cypress/integration/projects/access.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ describe('project-access', () => {
150150
});
151151

152152
it('can remove access', () => {
153-
cy.get(`[data-testid='${PA_REMOVE_BUTTON_ID}']`).first().click();
153+
cy.get(`[data-testid='${PA_REMOVE_BUTTON_ID}']`)
154+
.filter(':not(:disabled)')
155+
.first()
156+
.click();
154157

155158
cy.intercept(
156159
'DELETE',

frontend/cypress/support/UI.ts

+21-8
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const createFeature_UI = (
6060

6161
cy.wait(5_000);
6262

63-
cy.get('[data-testid=NAVIGATE_TO_CREATE_FEATURE').click(uiOpts);
63+
cy.get('[data-testid=NAVIGATE_TO_CREATE_FEATURE').first().click(uiOpts);
6464

6565
cy.intercept('POST', `/api/admin/projects/${projectName}/features`).as(
6666
'createFeature',
@@ -72,10 +72,14 @@ export const createFeature_UI = (
7272
cy.get("[data-testid='FORM_DESCRIPTION_INPUT'] textarea")
7373
.first()
7474
.type('hello-world', uiOpts);
75-
if (!shouldWait)
76-
return cy.get("[data-testid='FORM_CREATE_BUTTON']").click(uiOpts);
77-
else cy.get("[data-testid='FORM_CREATE_BUTTON']").click(uiOpts);
78-
return cy.wait('@createFeature');
75+
const clicked = cy
76+
.get("[data-testid='FORM_CREATE_BUTTON']")
77+
.first()
78+
.click(uiOpts);
79+
if (shouldWait) {
80+
return cy.wait('@createFeature');
81+
}
82+
return clicked;
7983
};
8084

8185
export const createProject_UI = (
@@ -161,7 +165,10 @@ export const addFlexibleRolloutStrategyToFeature_UI = (
161165
cy.get('[data-testid=ADD_CONSTRAINT_ID]').click();
162166
cy.get('[data-testid=DIALOGUE_CONFIRM_ID]').click();
163167
}
164-
cy.get(`[data-testid=STRATEGY_FORM_SUBMIT_ID]`).first().click();
168+
// this one needs to wait until the dropdown selector of stickiness is set, that's why waitForAnimations: true
169+
cy.get(`[data-testid=STRATEGY_FORM_SUBMIT_ID]`)
170+
.first()
171+
.click({ waitForAnimations: true });
165172
return cy.wait('@addStrategyToFeature');
166173
};
167174

@@ -209,7 +216,10 @@ export const updateFlexibleRolloutStrategy_UI = (
209216
},
210217
).as('updateStrategy');
211218

212-
cy.get(`[data-testid=STRATEGY_FORM_SUBMIT_ID]`).first().click();
219+
// this one needs to wait until the dropdown selector of stickiness is set, that's why waitForAnimations: true
220+
cy.get(`[data-testid=STRATEGY_FORM_SUBMIT_ID]`)
221+
.first()
222+
.click({ waitForAnimations: true });
213223
return cy.wait('@updateStrategy');
214224
};
215225

@@ -284,7 +294,10 @@ export const addUserIdStrategyToFeature_UI = (
284294
},
285295
).as('addStrategyToFeature');
286296

287-
cy.get(`[data-testid=STRATEGY_FORM_SUBMIT_ID]`).first().click();
297+
// this one needs to wait until the dropdown selector of stickiness is set, that's why waitForAnimations: true
298+
cy.get(`[data-testid=STRATEGY_FORM_SUBMIT_ID]`)
299+
.first()
300+
.click({ waitForAnimations: true });
288301
return cy.wait('@addStrategyToFeature');
289302
};
290303

frontend/cypress/support/commands.ts

+5
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,8 @@ Cypress.Commands.overwrite('visit', (originalFn, url, options = {}) => {
6868

6969
return originalFn(url, options);
7070
});
71+
72+
Cypress.Commands.overwrite('click', (originalFn, x, y, options = {}) => {
73+
options.waitForAnimations = false;
74+
return originalFn(x, y, options);
75+
});

frontend/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"react-test-renderer": "18.3.1",
116116
"sass": "1.85.1",
117117
"semver": "7.7.1",
118-
"swr": "2.3.2",
118+
"swr": "2.3.3",
119119
"tss-react": "4.9.15",
120120
"typescript": "5.4.5",
121121
"use-query-params": "^2.2.1",
@@ -124,7 +124,7 @@
124124
"vite-plugin-env-compatible": "2.0.1",
125125
"vite-plugin-svgr": "3.3.0",
126126
"vite-tsconfig-paths": "4.3.2",
127-
"vitest": "3.0.7",
127+
"vitest": "3.0.8",
128128
"whatwg-fetch": "3.6.20"
129129
},
130130
"resolutions": {

frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountModal/ServiceAccountModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export const ServiceAccountModal = ({
271271
modal
272272
title={editing ? 'Edit service account' : 'New service account'}
273273
description='A service account is a special type of account that can only be used to authenticate with the Unleash API. Service accounts can be used to automate tasks.'
274-
documentationLink='https://docs.getunleash.io'
274+
documentationLink='https://docs.getunleash.io/reference/service-accounts'
275275
documentationLinkLabel='Service accounts documentation'
276276
formatApiCode={formatApiCode}
277277
>

frontend/src/component/common/ApiTokenTable/RemoveApiTokenButton/RemoveApiTokenButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export const RemoveApiTokenButton = ({
6363
<br />
6464
<StyledUl>
6565
<li>
66-
<strong>username</strong>:{' '}
67-
<code>{token.username}</code>
66+
<strong>name</strong>:{' '}
67+
<code>{token.tokenName}</code>
6868
</li>
6969
<li>
7070
<strong>type</strong>: <code>{token.type}</code>

frontend/src/component/common/ApiTokenTable/useApiTokenTable.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const useApiTokenTable = (
3939
},
4040
{
4141
Header: 'Token name',
42-
accessor: 'username',
42+
accessor: 'tokenName',
4343
Cell: HighlightCell,
4444
minWidth: 35,
4545
},

frontend/src/component/demo/demo-topics.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ export const TOPICS: ITutorialTopic[] = [
315315
<>
316316
<Description>
317317
<a
318-
href='https://docs.getunleash.io/reference/activation-strategies#gradual-rollout'
318+
href='https://docs.getunleash.io/reference/activation-strategies'
319319
target='_blank'
320320
rel='noreferrer'
321321
>

frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentTokenDialog/EnvironmentTokenDialog.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const EnvironmentTokenDialog = ({
2929
Your new token has been created successfully.
3030
</Typography>
3131
<Typography variant='body1'>
32-
You can also find it as "<strong>{token?.username}</strong>" in the{' '}
32+
You can also find it as "<strong>{token?.tokenName}</strong>" in the{' '}
3333
<Link to='/admin/api'>API access page</Link>.
3434
</Typography>
3535
<UserToken token={token?.secret || ''} />

frontend/src/component/insights/componentsStat/HealthStats/HealthStats.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const HealthStats: FC<IHealthStatsProps> = ({
9999
</StyledStatsRow>
100100
<ExplanationRow>
101101
<Link
102-
href='https://docs.getunleash.io/reference/technical-debt'
102+
href='https://docs.getunleash.io/reference/insights#health'
103103
target='_blank'
104104
rel='noreferrer'
105105
>

frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureDetails/FeatureDetails.test.tsx

+26-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { screen } from '@testing-library/react';
22
import { render } from 'utils/testRenderer';
3-
import { FeatureDetails } from './FeatureDetails';
3+
import { FeatureDetails as LegacyFeatureDetails } from './LegacyFeatureDetails';
44
import type { PlaygroundFeatureSchema, PlaygroundRequestSchema } from 'openapi';
5+
import { FeatureDetails } from './FeatureDetails';
56

67
const testCases = [
78
{
@@ -10,7 +11,7 @@ const testCases = [
1011
hasUnsatisfiedDependency: true,
1112
isEnabledInCurrentEnvironment: false,
1213
} as PlaygroundFeatureSchema,
13-
expectedText1: 'This feature flag is False in development because',
14+
expectedText1: /This feature flag is False in development because/,
1415
expectedText2:
1516
'parent dependency is not satisfied and the environment is disabled',
1617
},
@@ -20,7 +21,7 @@ const testCases = [
2021
hasUnsatisfiedDependency: true,
2122
isEnabledInCurrentEnvironment: true,
2223
} as PlaygroundFeatureSchema,
23-
expectedText1: 'This feature flag is False in development because',
24+
expectedText1: /This feature flag is False in development because/,
2425
expectedText2: 'parent dependency is not satisfied',
2526
},
2627
{
@@ -29,15 +30,15 @@ const testCases = [
2930
hasUnsatisfiedDependency: false,
3031
isEnabledInCurrentEnvironment: false,
3132
} as PlaygroundFeatureSchema,
32-
expectedText1: 'This feature flag is False in development because',
33+
expectedText1: /This feature flag is False in development because/,
3334
expectedText2: 'the environment is disabled',
3435
},
3536
{
3637
name: 'Feature environment is enabled',
3738
feature: {
3839
isEnabled: true,
3940
} as PlaygroundFeatureSchema,
40-
expectedText1: 'This feature flag is True in development because',
41+
expectedText1: /This feature flag is True in development because/,
4142
expectedText2: 'at least one strategy is True',
4243
},
4344
{
@@ -48,7 +49,7 @@ const testCases = [
4849
data: [{ name: 'custom' }],
4950
},
5051
} as PlaygroundFeatureSchema,
51-
expectedText1: 'This feature flag is Unknown in development because',
52+
expectedText1: /This feature flag is Unknown in development because/,
5253
expectedText2: 'no strategies could be fully evaluated',
5354
},
5455
{
@@ -59,7 +60,7 @@ const testCases = [
5960
data: [{ name: 'custom' }, { name: 'default' }],
6061
},
6162
} as PlaygroundFeatureSchema,
62-
expectedText1: 'This feature flag is Unknown in development because',
63+
expectedText1: /This feature flag is Unknown in development because/,
6364
expectedText2: 'not all strategies could be fully evaluated',
6465
},
6566
{
@@ -70,12 +71,29 @@ const testCases = [
7071
data: [{ name: 'default' }],
7172
},
7273
} as PlaygroundFeatureSchema,
73-
expectedText1: 'This feature flag is False in development because',
74+
expectedText1: /This feature flag is False in development because/,
7475
expectedText2:
7576
'all strategies are either False or could not be fully evaluated',
7677
},
7778
];
7879

80+
testCases.forEach(({ name, feature, expectedText1, expectedText2 }) => {
81+
test(`${name} (legacy)`, async () => {
82+
render(
83+
<LegacyFeatureDetails
84+
feature={feature}
85+
input={
86+
{ environment: 'development' } as PlaygroundRequestSchema
87+
}
88+
onClose={() => {}}
89+
/>,
90+
);
91+
92+
await screen.findByText(expectedText1);
93+
await screen.findByText(expectedText2);
94+
});
95+
});
96+
7997
testCases.forEach(({ name, feature, expectedText1, expectedText2 }) => {
8098
test(name, async () => {
8199
render(

0 commit comments

Comments
 (0)