Skip to content

Commit

Permalink
Merge pull request #10601 from linode/release-v1.122.0
Browse files Browse the repository at this point in the history
Release v1.122.0 - release → staging
  • Loading branch information
cpathipa committed Jun 24, 2024
2 parents e5e0fd4 + 2e0d0cb commit 8730d9a
Show file tree
Hide file tree
Showing 264 changed files with 8,048 additions and 4,008 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ This repository is home to the Akamai Connected **[Cloud Manager](https://cloud.

## Developing Locally

To get started running Cloud Manager locally, please see the [_Getting Started_ guide](docs/GETTING_STARTED.md).
To get started running Cloud Manager locally, please see the [Getting Started guide](https://linode.github.io/manager/GETTING_STARTED.html).

## Contributing

If you already have your development environment set up, please read the [contributing guidelines](docs/CONTRIBUTING.md) to get help in creating your first Pull Request.
If you already have your development environment set up, please read the [Contributing Guidelines](https://linode.github.io/manager/CONTRIBUTING.html) to get help in creating your first Pull Request.

To report a bug or request a feature in Cloud Manager, please [open a GitHub Issue](https://github.com/linode/manager/issues/new). For general feedback, use [linode.com/feedback](https://www.linode.com/feedback/).

Expand Down
17 changes: 9 additions & 8 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@ Feel free to open an issue to report a bug or request a feature.
5. Commit message format standard: `<commit type>: [JIRA-ticket-number] - <description>`

**Commit Types:**
`feat`: New feature for the user (not a part of the code, or ci, ...).
`fix`: Bugfix for the user (not a fix to build something, ...).
`change`: Modifying an existing visual UI instance. Such as a component or a feature.
`refactor`: Restructuring existing code without changing its external behavior or visual UI. Typically to improve readability, maintainability, and performance.
`test`: New tests or changes to existing tests. Does not change the production code.
`upcoming`: A new feature that is in progress, not visible to users yet, and usually behind a feature flag.
- `feat`: New feature for the user (not a part of the code, or ci, ...).
- `fix`: Bugfix for the user (not a fix to build something, ...).
- `change`: Modifying an existing visual UI instance. Such as a component or a feature.
- `refactor`: Restructuring existing code without changing its external behavior or visual UI. Typically to improve readability, maintainability, and performance.
- `test`: New tests or changes to existing tests. Does not change the production code.
- `upcoming`: A new feature that is in progress, not visible to users yet, and usually behind a feature flag.

**Example:** `feat: [M3-1234] - Allow user to view their login history`

6. Open a pull request against `develop` and make sure the title follows the same format as the commit message.
7. If needed, create a changeset to populate our changelog
- If you don't have the Github CLI installed or need to update it (you need GH CLI 2.21.0 or greater),
- If you don't have the Github CLI installed or need to update it (you need GH CLI 2.21.0 or greater),
- install it via `brew`: https://cli.github.com/manual/installation or upgrade with `brew upgrade gh`
- Once installed, run `gh repo set-default` and pick `linode/manager` (only > 2.21.0)
- You can also just create the changeset manually, in this case make sure to use the proper formatting for it.
- Run `yarn changeset`from the root, choose the package to create a changeset for, and provide a description for the change.
You can either have it committed automatically or do it manually if you need to edit it.
- A changeset is optional, it merely depends if it falls in one of the following categories:
- A changeset is optional, but should be included if the PR falls in one of the following categories:<br>
`Added`, `Fixed`, `Changed`, `Removed`, `Tech Stories`, `Tests`, `Upcoming Features`
- Select the changeset category that matches the commit type in your PR title. (Where this isn't a 1:1 match: generally, a `feat` commit type falls under an `Added` change and `refactor` falls under `Tech Stories`.)

Two reviews from members of the Cloud Manager team are required before merge. After approval, all pull requests are squash merged.

Expand Down
7 changes: 4 additions & 3 deletions docs/development-guide/08-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ These environment variables are specific to Cloud Manager UI tests. They can be
###### General
Environment variables related to the general operation of the Cloud Manager Cypress tests.

| Environment Variable | Description | Example | Default |
|----------------------|-------------------------------------------------------------------------------------------------------|----------|---------------------------------|
| `CY_TEST_SUITE` | Name of the Cloud Manager UI test suite to run. Possible values are `core`, `region`, or `synthetic`. | `region` | Unset; defaults to `core` suite |
| Environment Variable | Description | Example | Default |
|----------------------|-------------------------------------------------------------------------------------------------------|--------------|---------------------------------|
| `CY_TEST_SUITE` | Name of the Cloud Manager UI test suite to run. Possible values are `core`, `region`, or `synthetic`. | `region` | Unset; defaults to `core` suite |
| `CY_TEST_TAGS` | Query identifying tests that should run by specifying allowed and disallowed tags. | `method:e2e` | Unset; all tests run by default |

###### Regions
These environment variables are used by Cloud Manager's UI tests to override region selection behavior. This can be useful for testing Cloud Manager functionality against a specific region.
Expand Down
37 changes: 36 additions & 1 deletion docs/development-guide/15-api-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In order to display these messages in the application (Notification Center, /eve
## Adding a new Action and Composing Messages

In order to add a new Action, one must add a new key to the read-only `EventActionKeys` constant array in the api-v4 package.
Once that's done, a related entry must be added to the `eventMessages` Event Map. In order to do so, the entry can either be added to an existing Event Factory or a new one. `eventMessages` is strictly typed, so the decision where to add the new Action will be clear. ex:
Once that's done, a related entry must be added to the `eventMessages` Event Map. In order to do so, the entry can either be added to an existing Event Factory or a new one. `eventMessages` is strictly typed, so the action needs to be added to an existing factory or a new one, depending on its key (in this example the action starts with `linode_` so it belongs in the `linode.tsx` factory):

```Typescript
import { EventLink } from '../EventLink';
Expand All @@ -32,6 +32,41 @@ The convention to compose the message is as follows:
- the primary action: (ex: `<strong>created</strong>`)
- its correlated negation for negative actions (ex: `could <strong>not</strong> be <strong>created</strong>.`)
- The `message` should be also handled via the `<EventMessage message={e.message} />` in order to handle potential formatting from the API string (ticks to indicate code blocks).
- The message composition can be enhanced by using custom components. For instance, if we need to fetch extra data based on an event entity, we can simply write a new component to include in the message:

```Typescript
export const linode: PartialEventMap<'linode'> = {
linode_migrate_datacenter: {
started: (e) => <LinodeMigrateDataCenterMessage event={e} />,
},
};

const LinodeMigrateDataCenterMessage = ({ event }: { event: Event }) => {
const { data: linode } = useLinodeQuery(event.entity?.id ?? -1);
const { data: regions } = useRegionsQuery();
const region = regions?.find((r) => r.id === linode?.region);

return (
<>
Linode <EventLink event={event} to="entity" /> is being{' '}
<strong>migrated</strong>
{region && (
<>
{' '}
to <strong>{region.label}</strong>
</>
)}
.
</>
);
};
```

## In Progress Events

Some event messages are meant to be displayed alongside a progress bar to show the user the percentage of the action's completion. When an action is in progress, the polling interval switches to every two seconds to provide real-time feedback.

Despite receiving a `percent_complete` value from the API, not all actions are suitable for displaying visual progress, often because they're too short, or we only receive 0% and 100% from the endpoint. To allow only certain events to feature the progress bar, their action keys must be added to the `ACTIONS_TO_INCLUDE_AS_PROGRESS_EVENTS` constant.

## Displaying Events in snackbars

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"npm-run-all": "^4.1.5",
"patch-package": "^7.0.0",
"postinstall": "^0.6.0",
"typescript": "^4.9.5"
"typescript": "^5.4.5"
},
"husky": {
"hooks": {
Expand Down
15 changes: 8 additions & 7 deletions packages/api-v4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## [2024-06-10] - v0.119.0
## [2024-06-24] - v0.120.0

### Added:

- New endpoint for LKE HA types used in pricing ([#10505](https://github.com/linode/manager/pull/10505))
- UpdateImagePayload type ([#10514](https://github.com/linode/manager/pull/10514))
- New endpoint for `network-transfer/prices` ([#10566](https://github.com/linode/manager/pull/10566))

## [2024-06-10] - v0.119.0

### Added:

Expand All @@ -19,7 +26,6 @@

## [2024-05-28] - v0.118.0


### Added:

- New LKE events in `EventAction` type ([#10443](https://github.com/linode/manager/pull/10443))
Expand All @@ -28,10 +34,8 @@

- Add Disk Encryption to AccountCapability type and region Capabilities type ([#10462](https://github.com/linode/manager/pull/10462))


## [2024-05-13] - v0.117.0


### Added:

- 'edge' Linode type class ([#10415](https://github.com/linode/manager/pull/10415))
Expand All @@ -46,17 +50,14 @@

- Update Placement Group event types ([#10420](https://github.com/linode/manager/pull/10420))


## [2024-05-06] - v0.116.0


### Added:

- 'edge' Linode type class ([#10441](https://github.com/linode/manager/pull/10441))

## [2024-04-29] - v0.115.0


### Added:

- New endpoint for `volumes/types` ([#10376](https://github.com/linode/manager/pull/10376))
Expand Down
4 changes: 2 additions & 2 deletions packages/api-v4/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@linode/api-v4",
"version": "0.119.0",
"version": "0.120.0",
"homepage": "https://github.com/linode/manager/tree/develop/packages/api-v4",
"bugs": {
"url": "https://github.com/linode/manager/issues"
Expand Down Expand Up @@ -67,7 +67,7 @@
"lint-staged": "^13.2.2",
"prettier": "~2.2.1",
"tsup": "^7.2.0",
"vitest": "^1.3.1"
"vitest": "^1.6.0"
},
"lint-staged": {
"*.{ts,tsx,js}": [
Expand Down
17 changes: 3 additions & 14 deletions packages/api-v4/src/images/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type {
CreateImagePayload,
Image,
ImageUploadPayload,
UpdateImagePayload,
UploadImageResponse,
} from './types';

Expand Down Expand Up @@ -58,21 +59,9 @@ export const createImage = (data: CreateImagePayload) => {
* Updates a private Image that you have permission to read_write.
*
* @param imageId { string } ID of the Image to look up.
* @param label { string } A short description of the Image. Labels cannot contain special characters.
* @param description { string } A detailed description of this Image.
* @param data { UpdateImagePayload } the updated image details
*/
export const updateImage = (
imageId: string,
label?: string,
description?: string,
tags?: string[]
) => {
const data = {
...(label && { label }),
...(description && { description }),
...(tags && { tags }),
};

export const updateImage = (imageId: string, data: UpdateImagePayload) => {
return Request<Image>(
setURL(`${API_ROOT}/images/${encodeURIComponent(imageId)}`),
setMethod('PUT'),
Expand Down
4 changes: 3 additions & 1 deletion packages/api-v4/src/images/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export type ImageStatus =
| 'deleted'
| 'pending_upload';

type ImageCapabilities = 'cloud-init' | 'distributed-images';
export type ImageCapabilities = 'cloud-init' | 'distributed-images';

type ImageType = 'manual' | 'automatic';

Expand Down Expand Up @@ -148,6 +148,8 @@ export interface CreateImagePayload extends BaseImagePayload {
disk_id: number;
}

export type UpdateImagePayload = Omit<BaseImagePayload, 'cloud_init'>;

export interface ImageUploadPayload extends BaseImagePayload {
label: string;
region: string;
Expand Down
2 changes: 2 additions & 0 deletions packages/api-v4/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export * from './managed';

export * from './networking';

export * from './network-transfer';

export * from './nodebalancers';

export * from './object-storage';
Expand Down
16 changes: 14 additions & 2 deletions packages/api-v4/src/kubernetes/kubernetes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Request, {
setURL,
setXFilter,
} from '../request';
import { Filter, Params, ResourcePage as Page } from '../types';
import {
import type { Filter, Params, ResourcePage as Page, PriceType } from '../types';
import type {
CreateKubeClusterPayload,
KubeConfigResponse,
KubernetesCluster,
Expand Down Expand Up @@ -180,3 +180,15 @@ export const recycleClusterNodes = (clusterID: number) =>
setMethod('POST'),
setURL(`${API_ROOT}/lke/clusters/${encodeURIComponent(clusterID)}/recycle`)
);

/**
* getKubernetesTypes
*
* Returns a paginated list of available Kubernetes types; used for dynamic pricing.
*/
export const getKubernetesTypes = (params?: Params) =>
Request<Page<PriceType>>(
setURL(`${API_ROOT}/lke/types`),
setMethod('GET'),
setParams(params)
);
1 change: 1 addition & 0 deletions packages/api-v4/src/network-transfer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './prices';
10 changes: 10 additions & 0 deletions packages/api-v4/src/network-transfer/prices.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { API_ROOT } from 'src/constants';
import Request, { setMethod, setURL, setParams } from 'src/request';
import { Params, PriceType, ResourcePage } from 'src/types';

export const getNetworkTransferPrices = (params?: Params) =>
Request<ResourcePage<PriceType>>(
setURL(`${API_ROOT}/network-transfer/prices`),
setMethod('GET'),
setParams(params)
);
4 changes: 2 additions & 2 deletions packages/api-v4/src/regions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ export interface RegionAvailability {
region: string;
}

type ContinentCode = keyof typeof COUNTRY_CODE_TO_CONTINENT_CODE;
type CountryCode = keyof typeof COUNTRY_CODE_TO_CONTINENT_CODE;

export type Country = Lowercase<ContinentCode>;
export type Country = Lowercase<CountryCode>;

This file was deleted.

Loading

0 comments on commit 8730d9a

Please sign in to comment.