Skip to content

Commit 1ef9498

Browse files
Merge pull request #11519 from linode/staging
Release v1.134.0 - staging → master
2 parents 1f0844b + a738061 commit 1ef9498

File tree

623 files changed

+22360
-5168
lines changed

Some content is hidden

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

623 files changed

+22360
-5168
lines changed

docs/development-guide/13-coding-standards.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,19 @@ We use [ESLint](https://eslint.org/) to enforce coding and formatting standards.
1414
If you are using VSCode it is **highly** recommended to use the [ESlint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint). The [Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) is also recommended, as it can be configured to format your code on save.
1515

1616
## React
17+
### useEffect()
18+
`useEffect()` should only be used for handling true side effects - specifically API calls, subscriptions, and DOM mutations that must occur outside React's render cycle. While you may encounter instances where `useEffect()` is used differently throughout our existing codebase, we're actively working to remove those instances. Existing code that does not adhere to the hook's proper use should not be used as precedent for implementing new `useEffect()` instances. All state updates and data transformations should be handled through event handlers and direct state management.
1719

20+
When Not to Use Effects:
21+
- Prop synchronization with state
22+
- Derived state calculations
23+
- Post-render state updates
24+
- Props/state triggers for child components
25+
- Chaining state updates
26+
27+
Reference: https://react.dev/learn/you-might-not-need-an-effect
28+
29+
### useId()
1830
[Several new hooks were introduced with the release of React 18](https://react.dev/blog/2022/03/29/react-v18#new-hooks).
1931

2032
It should be noted that the `useId()` hook is particularly useful for generating unique IDs for accessibility attributes. For this use case, `useId()` is preferred over hardcoding the ID because components may be rendered more than once on a page, but IDs must be unique.

docs/tooling/analytics.md

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
11
# Analytics
22

3+
## Pendo
4+
5+
Cloud Manager uses [Pendo](https://www.pendo.io/pendo-for-your-customers/) to capture analytics, guide users, and improve the user experience. Pendo is the **preferred** method for collecting analytics, including user events, since it requires no development effort and can be accomplished via the Pendo UI.
6+
7+
To view Pendo dashboards, Cloud Manager developers must follow internal processes to request access.
8+
9+
### Set Up and Initialization
10+
11+
Pendo is configured in [`usePendo.js`](https://github.com/linode/manager/blob/develop/packages/manager/src/hooks/usePendo.ts). This custom hook allows us to initialize the Pendo analytics script when the [App](https://github.com/linode/manager/blob/develop/packages/manager/src/App.tsx#L56) is mounted.
12+
13+
Important notes:
14+
15+
- Pendo is only loaded if a valid `PENDO_API_KEY` is configured as an environment variable. In our development, staging, and production environments, `PENDO_API_KEY` is available at build time. See **Locally Testing Page Views & Custom Events and/or Troubleshooting Pendo** for set up with local environments.
16+
- We load the Pendo agent from the CDN, rather than [self-hosting](https://support.pendo.io/hc/en-us/articles/360038969692-Self-hosting-the-Pendo-agent), and we have configured a [CNAME](https://support.pendo.io/hc/en-us/articles/360043539891-CNAME-for-Pendo).
17+
- We are hashing account and visitor IDs in a way that is consistent with Akamai's standards.
18+
- At initialization, we do string transformation on select URL patterns to **remove sensitive data**. When new URL patterns are added to Cloud Manager, verify that existing transforms remove sensitive data; if not, update the transforms.
19+
- Pendo is currently not using any client-side (cookies or local) storage.
20+
- Pendo makes use of the existing `data-testid` properties, used in our automated testing, for tagging elements. They are more persistent and reliable than CSS properties, which are liable to change.
21+
22+
### Locally Testing Page Views & Custom Events and/or Troubleshooting Pendo
23+
24+
1. Set the `REACT_APP_PENDO_API_KEY` environment variable in `.env`.
25+
2. Use the browser tools Network tab, filter requests by "psp.cloud", and check that successful network requests have been made to load Pendo scripts (also visible in the browser tools Sources tab).
26+
3. In the browser console, type `pendo.validateEnvironment()`.
27+
4. You should see command output in the console, and it should include a hashed `accountId` and hashed `visitorId`. Each page view change or custom event that fires should be visible as a request in the Network tab.
28+
5. If the console does not output the expected ids and instead outputs something like `Cookies are disabled in Pendo config. Is this expected?` in response to the above command, clear app storage with the browser tools. Once redirected back to Login, update the OneTrust cookie settings to enable cookies via "Manage Preferences" in the banner at the bottom of the screen. Log back into Cloud Manager and Pendo should load.
29+
330
## Adobe Analytics
431

5-
Cloud Manager uses Adobe Analytics to capture page view and custom event statistics. To view analytics, Cloud Manager developers must follow internal processes to request access to Adobe Analytics dashboards.
32+
Cloud Manager uses Adobe Analytics to capture page view and custom event statistics, although Pendo is the preferred method for collecting this data where possible, as of Q4 2024. To view analytics, Cloud Manager developers must follow internal processes to request access to Adobe Analytics dashboards.
633

734
### Writing a Custom Event
835

@@ -63,27 +90,3 @@ See the `LinodeCreateForm` form events as an example.
6390
3. In the browser console, type `_satellite.setDebug(true)`.
6491
4. Refresh the page. You should see Adobe debug log output in the console. Each page view change or custom event that fires should be visible in the logs.
6592
5. When viewing dashboards in Adobe Analytics, it may take ~1 hour for analytics data to update. Once this happens, locally fired events will be visible in the dev dashboard.
66-
67-
## Pendo
68-
69-
Cloud Manager uses [Pendo](https://www.pendo.io/pendo-for-your-customers/) to capture analytics, guide users, and improve the user experience. To view Pendo dashboards, Cloud Manager developers must follow internal processes to request access.
70-
71-
### Set Up and Initialization
72-
73-
Pendo is configured in [`usePendo.js`](https://github.com/linode/manager/blob/develop/packages/manager/src/hooks/usePendo.ts). This custom hook allows us to initialize the Pendo analytics script when the [App](https://github.com/linode/manager/blob/develop/packages/manager/src/App.tsx#L56) is mounted.
74-
75-
Important notes:
76-
77-
- Pendo is only loaded if a valid `PENDO_API_KEY` is configured as an environment variable. In our development, staging, and production environments, `PENDO_API_KEY` is available at build time. See **Locally Testing Page Views & Custom Events and/or Troubleshooting Pendo** for set up with local environments.
78-
- We load the Pendo agent from the CDN, rather than [self-hosting](https://support.pendo.io/hc/en-us/articles/360038969692-Self-hosting-the-Pendo-agent).
79-
- We are hashing account and visitor IDs in a way that is consistent with Akamai's standards.
80-
- At initialization, we do string transformation on select URL patterns to **remove sensitive data**. When new URL patterns are added to Cloud Manager, verify that existing transforms remove sensitive data; if not, update the transforms.
81-
- Pendo is currently not using any client-side (cookies or local) storage.
82-
- Pendo makes use of the existing `data-testid` properties, used in our automated testing, for tagging elements. They are more persistent and reliable than CSS properties, which are liable to change.
83-
84-
### Locally Testing Page Views & Custom Events and/or Troubleshooting Pendo
85-
86-
1. Set the `REACT_APP_PENDO_API_KEY` environment variable in `.env`.
87-
2. Use the browser tools Network tab, filter requests by "pendo", and check that successful network requests have been made to load Pendo scripts. (Also visible in browser tools Sources tab.)
88-
3. In the browser console, type `pendo.validateEnvironment()`.
89-
4. You should see command output in the console, and it should include a hashed `accountId` and hashed `visitorId`. Each page view change or custom event that fires should be visible as a request in the Network tab.

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"test:sdk": "yarn workspace @linode/api-v4 test",
3131
"test:search": "yarn workspace @linode/search test",
3232
"test:ui": "yarn workspace @linode/ui test",
33-
"package-versions": "node ./scripts/package-versions/index.js",
33+
"package-versions": "yarn workspace @linode/scripts package-versions",
3434
"storybook": "yarn workspace linode-manager storybook",
3535
"cy:run": "yarn workspace linode-manager cy:run",
3636
"cy:e2e": "yarn workspace linode-manager cy:e2e",
@@ -39,23 +39,25 @@
3939
"cy:component": "yarn workspace linode-manager cy:component",
4040
"cy:component:run": "yarn workspace linode-manager cy:component:run",
4141
"cy:rec-snap": "yarn workspace linode-manager cy:rec-snap",
42-
"changeset": "node scripts/changelog/changeset.mjs",
43-
"generate-changelogs": "node scripts/changelog/generate-changelogs.mjs",
42+
"changeset": "yarn workspace @linode/scripts changeset",
43+
"generate-changelogs": "yarn workspace @linode/scripts generate-changelogs",
4444
"coverage": "yarn workspace linode-manager coverage",
4545
"coverage:summary": "yarn workspace linode-manager coverage:summary",
46-
"junit:summary": "tsx scripts/junit-summary/index.ts",
47-
"generate-tod": "tsx scripts/tod-payload/index.ts",
46+
"junit:summary": "YARN_SILENT=1 yarn workspace @linode/scripts junit:summary",
47+
"generate-tod": "YARN_SILENT=1 yarn workspace @linode/scripts generate-tod",
4848
"docs": "bunx vitepress@1.0.0-rc.44 dev docs",
4949
"prepare": "husky"
5050
},
5151
"resolutions": {
5252
"node-fetch": "^2.6.7",
5353
"yaml": "^2.3.0",
54-
"semver": "^7.5.2"
54+
"semver": "^7.5.2",
55+
"cookie": "^0.7.0"
5556
},
5657
"workspaces": {
5758
"packages": [
58-
"packages/*"
59+
"packages/*",
60+
"scripts"
5961
]
6062
},
6163
"version": "0.0.0",

packages/api-v4/CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
## [2025-01-14] - v0.132.0
2+
3+
### Added:
4+
5+
- Types for UDP NodeBalancer support ([#11321](https://github.com/linode/manager/pull/11321))
6+
- Tags to `KubeNodePoolResponse` and `UpdateNodePoolData` ([#11368](https://github.com/linode/manager/pull/11368))
7+
8+
### Changed:
9+
10+
- Type of `AlertDefinitionType` to `'system'|'user'` ([#11346](https://github.com/linode/manager/pull/11346))
11+
- Property names, and types of the CreateAlertDefinitionPayload and Alert interfaces ([#11392](https://github.com/linode/manager/pull/11392))
12+
- BaseDatabase total_disk_size_gb and used_disk_size_gb are always expected and used_disk_size_gb can be null ([#11426](https://github.com/linode/manager/pull/11426))
13+
- Renamed `AvailableMetrics` type to `MetricDefinition` ([#11433](https://github.com/linode/manager/pull/11433))
14+
- Changed MetricCritera, DimensionFilter and Alert Interfaces ([#11445](https://github.com/linode/manager/pull/11445))
15+
16+
### Fixed:
17+
18+
- Nullable AccountBeta ended & description properties ([#11347](https://github.com/linode/manager/pull/11347))
19+
- Incorrect return type of `updateObjectACL` ([#11369](https://github.com/linode/manager/pull/11369))
20+
21+
### Removed:
22+
23+
- getAccountInfoBeta endpoint ([#11413](https://github.com/linode/manager/pull/11413))
24+
- `MetricDefinitions` type ([#11433](https://github.com/linode/manager/pull/11433))
25+
26+
### Upcoming Features:
27+
28+
- Fix types for IAM API ([#11397](https://github.com/linode/manager/pull/11397))
29+
- Add new `getAlertDefinitionByServiceTypeAndId` endpoint to fetch Cloud Pulse alert details by id and service type ([#11399](https://github.com/linode/manager/pull/11399))
30+
- New `Block Storage Performance B1` linode capability ([#11400](https://github.com/linode/manager/pull/11400))
31+
- Add `getKubernetesTypesBeta` function ([#11419](https://github.com/linode/manager/pull/11419))
32+
133
## [2024-12-10] - v0.131.0
234

335
### Added:

packages/api-v4/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@linode/api-v4",
3-
"version": "0.131.0",
3+
"version": "0.132.0",
44
"homepage": "https://github.com/linode/manager/tree/develop/packages/api-v4",
55
"bugs": {
66
"url": "https://github.com/linode/manager/issues"

packages/api-v4/src/account/account.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@ export const getAccountInfo = () => {
3535
return Request<Account>(setURL(`${API_ROOT}/account`), setMethod('GET'));
3636
};
3737

38-
/**
39-
* getAccountInfoBeta
40-
*
41-
* Return beta endpoint account information,
42-
* including contact and billing info.
43-
*
44-
* @TODO LKE-E - M3-8838: Clean up after released to GA, if not otherwise in use
45-
*/
46-
export const getAccountInfoBeta = () => {
47-
return Request<Account>(setURL(`${BETA_API_ROOT}/account`), setMethod('GET'));
48-
};
49-
5038
/**
5139
* getNetworkUtilization
5240
*

packages/api-v4/src/account/types.ts

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,35 @@ export interface Account {
5959

6060
export type BillingSource = 'linode' | 'akamai';
6161

62-
export type AccountCapability =
63-
| 'Akamai Cloud Load Balancer'
64-
| 'Akamai Cloud Pulse'
65-
| 'Block Storage'
66-
| 'Block Storage Encryption'
67-
| 'Cloud Firewall'
68-
| 'CloudPulse'
69-
| 'Disk Encryption'
70-
| 'Kubernetes'
71-
| 'Kubernetes Enterprise'
72-
| 'Linodes'
73-
| 'LKE HA Control Planes'
74-
| 'LKE Network Access Control List (IP ACL)'
75-
| 'Machine Images'
76-
| 'Managed Databases'
77-
| 'Managed Databases Beta'
78-
| 'NETINT Quadra T1U'
79-
| 'NodeBalancers'
80-
| 'Object Storage Access Key Regions'
81-
| 'Object Storage Endpoint Types'
82-
| 'Object Storage'
83-
| 'Placement Group'
84-
| 'SMTP Enabled'
85-
| 'Support Ticket Severity'
86-
| 'Vlans'
87-
| 'VPCs';
62+
export const accountCapabilities = [
63+
'Akamai Cloud Load Balancer',
64+
'Akamai Cloud Pulse',
65+
'Block Storage',
66+
'Block Storage Encryption',
67+
'Cloud Firewall',
68+
'CloudPulse',
69+
'Disk Encryption',
70+
'Kubernetes',
71+
'Kubernetes Enterprise',
72+
'Linodes',
73+
'LKE HA Control Planes',
74+
'LKE Network Access Control List (IP ACL)',
75+
'Machine Images',
76+
'Managed Databases',
77+
'Managed Databases Beta',
78+
'NETINT Quadra T1U',
79+
'NodeBalancers',
80+
'Object Storage Access Key Regions',
81+
'Object Storage Endpoint Types',
82+
'Object Storage',
83+
'Placement Group',
84+
'SMTP Enabled',
85+
'Support Ticket Severity',
86+
'Vlans',
87+
'VPCs',
88+
] as const;
89+
90+
export type AccountCapability = typeof accountCapabilities[number];
8891

8992
export interface AccountAvailability {
9093
region: string; // will be slug of dc (matches id field of region object returned by API)
@@ -604,8 +607,8 @@ export interface AccountBeta {
604607
label: string;
605608
started: string;
606609
id: string;
607-
ended?: string;
608-
description?: string;
610+
ended: string | null;
611+
description: string | null;
609612
/**
610613
* The datetime the account enrolled into the beta
611614
* @example 2024-10-23T14:22:29

packages/api-v4/src/cloudpulse/alerts.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import { createAlertDefinitionSchema } from '@linode/validation';
2-
import Request, { setURL, setMethod, setData } from '../request';
2+
import Request, {
3+
setURL,
4+
setMethod,
5+
setData,
6+
setParams,
7+
setXFilter,
8+
} from '../request';
39
import { Alert, AlertServiceType, CreateAlertDefinitionPayload } from './types';
4-
import { BETA_API_ROOT as API_ROOT } from 'src/constants';
10+
import { BETA_API_ROOT as API_ROOT } from '../constants';
11+
import { Params, Filter, ResourcePage } from '../types';
512

613
export const createAlertDefinition = (
714
data: CreateAlertDefinitionPayload,
@@ -16,3 +23,24 @@ export const createAlertDefinition = (
1623
setMethod('POST'),
1724
setData(data, createAlertDefinitionSchema)
1825
);
26+
27+
export const getAlertDefinitions = (params?: Params, filters?: Filter) =>
28+
Request<ResourcePage<Alert>>(
29+
setURL(`${API_ROOT}/monitor/alert-definitions`),
30+
setMethod('GET'),
31+
setParams(params),
32+
setXFilter(filters)
33+
);
34+
35+
export const getAlertDefinitionByServiceTypeAndId = (
36+
serviceType: string,
37+
alertId: number
38+
) =>
39+
Request<Alert>(
40+
setURL(
41+
`${API_ROOT}/monitor/services/${encodeURIComponent(
42+
serviceType
43+
)}/alert-definitions/${encodeURIComponent(alertId)}`
44+
),
45+
setMethod('GET')
46+
);

packages/api-v4/src/cloudpulse/services.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import Request, { setData, setMethod, setURL } from '../request';
33
import {
44
JWEToken,
55
JWETokenPayLoad,
6-
MetricDefinitions,
6+
MetricDefinition,
77
ServiceTypesList,
88
} from './types';
9-
import { ResourcePage as Page } from 'src/types';
9+
import { ResourcePage } from 'src/types';
1010

1111
export const getMetricDefinitionsByServiceType = (serviceType: string) => {
12-
return Request<Page<MetricDefinitions>>(
12+
return Request<ResourcePage<MetricDefinition>>(
1313
setURL(
1414
`${API_ROOT}/monitor/services/${encodeURIComponent(
1515
serviceType

0 commit comments

Comments
 (0)