Skip to content

Commit

Permalink
Merging latest develop changes (#23)
Browse files Browse the repository at this point in the history
* feat: [UIE-8194] - DBaaS major and minor upgrades - 4 (linode#11199)

* feat: [M3-8831] - New GPUv2 egress transfer display (linode#11209)

* Add new gpuV2 egress transferlogic

* light cleanup

* adjust e2e s

* Added changeset: New GPUv2 egress transfer helpers

* feedback @coliu-akamai @hkhalil-akamai

* feedback @coliu-akamai @jaalah-akamai

* feedback optimization

* change: [M3-8806] - Disable unsupported images for distributed regions (linode#11206)

## Description 📝
In the Linode Create flow, when a distributed region is selected, images & distros that do not support distributed regions should be disabled

Note: It looks like the distributions are now sorted alphabetically. I don't see any issues with this but just wanted to point that out in case anyone did

## Changes  🔄
List any change relevant to the reviewer.
- Disable unsupported images/distros for distributed regions in Linode Create
- Removed the distributed icon & associated icon text
- Removed the word `currently` in the Add-Ons warning notice for distributed regions
- Added a new generic `ListItemOption` component and refactored `ImageOption`, `PlacementGroupSelectOption`, and `RegionOption` to use new generic component

## Target release date 🗓️
11/12

## How to test 🧪

### Prerequisites
(How to setup test environment)
- Ensure your account has the `new-dc-testing`, `new-dc-testing-gecko`, `edge_testing` and `edge_compute` customer tags

### Verification steps
(How to verify changes)
- Go to the Linode Create page and verify the following on the `OS` tab and `Images` tab:
  - Select a core region -> No Images/distributions should be disabled
  - Select a distributed region -> Images/distributions that do not support distributed regions should be disabled
- There should be no regressions in the components that were refactored
- Ensure unit tests and e2e tests are passing locally/remotely

* fix: [UIE-8246] - DBaaS provisioning 2 node clusters (linode#11218)

* feat : [M3-8528] - Include Object Storage buckets in Support tickets' dropdown (linode#11178)

* feat: [M3-8528] - Include Object Storage in Support Tickets

* query change

* Added changeset: Include Object Storage buckets in Support tickets dropdown

* added link support for object storage

* removed redundant query

* query updation and restructuring request payload

* Added changeset

* Initial Changelog

* refactor: [M3-8646] – Migrate `Divider` to `ui` package  (linode#11205)

* refactor: [M3-8646] – Migrate `Divider` to `ui` package

* Added changeset: Migrate Divider to ui package

* migrating all  imports

* removing redundant hook imports

* updated the import for omittedProps

* UIE-8247: Conditionally give the new docs as the link on database landing page (linode#11227)

* fix: [M3-8764] - Kubernetes UI issues (linode#11217)

* initial clean up

* save progress

* add changeset

* fix type error

* feedback @mjac0bs

* a few more small fixes

* a few more small fixes

---------

Co-authored-by: Banks Nussman <banks@nussman.us>

* upcoming: [DI-21811] - Post processing of missing timestamp data across dimensions in ACLP charts (linode#11225)

* upcoming: [DI-18419] - chart post processing for missing timestamps

* upcoming: [DI-21811] - Code corrections and refactoring

* upcoming: [DI-21811] - Code corrections and refactoring

* upcoming: [DI-21811] - Code corrections and refactoring

* upcoming: [DI-21811] - Added changeset

* upcoming: [DI-21811] - comment updates

* upcoming: [DI-21811] - comment updates

* upcoming: [DI-21811] - comment updates

* upcoming: [DI-21811] - comment updates

* upcoming: [DI-21811] - early returns for empty array

---------

Co-authored-by: vmangalr <vmangalr@akamai.com>

* Update changelog

* refactor: [M3-8650] - Migrate Stack to `@linode/ui` package (linode#11228)

* migrate stack, update organization for divider/icon button

* Added changeset: `Stack` component to `ui` package

* refactor: [M3-8710] - Move `Notice` & `Tooltip` components to UI package and update imports (linode#11174)

* Move Notice to UI package and update imports

* Add test imports

* Add renderWithTheme and other changes to make tests pass

* Fix broken icon imports

* Added changeset: Move `Notice` and `Tooltip` components to UI package

* Feedback @dwiley-akamai: consolidate imports and rename icon exports

* change: [M3-7337] - change Linode Details Summary VPC IPv4 Text to Copy Object. (linode#11172)

* change: [M3-7337] - change Linode Details Summary VPC IPv4 Text to Copy Object.

* Added changeset: change Linode Details Summary VPC IPv4 Text to Copy Object.

* Update changeset description

Co-authored-by: Purvesh Makode <pmakode@akamai.com>

* remove optional chaining

* change Text from "Subnets" to "Subnet"

* remove extra borderTop

* refactor: [M3-7337] - change Linode Details Summary VPC IPv4 Text to Copy Object

* Add descriptive variable name

---------

Co-authored-by: Purvesh Makode <pmakode@akamai.com>

* upcoming: [DI-21814] - ACLP UI - DBaaS instances order by label (linode#11226)

* upcoming: [DI-21814] - DBaaS instances order by label

* upcoming: [DI-21814] - Added changeset

* DI-21814: use map for better readability and optimisations

---------

Co-authored-by: vmangalr <vmangalr@akamai.com>

* UIE-8254: Add tooltip for ipv6 for new db clusters (linode#11231)

* feat: [UIE-8193] - Usable Storage Tooltip for Create/Resize Database table (linode#11232)

* feat: [UIE-8193] - Tooltip for Create/Resize Database table

* feat: [UIE-8193] - Tooltip context for small screens

* feat: [UIE-8193] - Tooltip for Create/Resize Database table (linode#11223)

* feat: [UIE-8193] - Tooltip for Create/Resize Database table

* Added changeset: Tooltip for 'Usable Storage' in Create/Resize Database Table

* feat: [UIE-8193] - Tooltip context for small screens

* DBaaS additions

* GPU egress transfer copy update (linode#11235)

* default behavior when creating new child clusters should match what existed before we enabled IPACL (in other words: disabled by default) (linode#11234)

Co-authored-by: Talmai Oliveira <toliveir@akamai.com>

* Update PULL_REQUEST_TEMPLATE.md (linode#11219)

* change: [M3-8860] - Update unit testing docs to prefer `userEvent` over `fireEvent` (linode#11221)

* Update 08-testing.md for userEvent

* Fix typo

* Address feedback; also further clean up linting issues the doc

* Fix a bad test that was not following good practices

* Added changeset: Update developer docs on unit testing user events

* Update changelog

* Fix LKE create ACL tests (linode#11237)

* feat: [M3-8665] - add option to copy token in LKE details page. (linode#11179)

* feat: [M3-8665] - add option to copy token in LKE details page.

* Added changeset: option to copy token in LKE details page

* Change the "Copy Token" button to use asynchronous functionality

* remove extra styling

* refactor: [M3-8665] - add option to copy token in LKE details page.

* Change cypress test for LKE update spec

* fix: sx styling for Textfield component (linode#11246)

* spread containerProps sx

* spread props.sx as well whoops

* fix: [M3-8894] - Linode Create crash when selected a Linode with a `type` that is `null` (linode#11247)

* don't fetch when `type` is an empty string

* fix and changelog entry

---------

Co-authored-by: Banks Nussman <banks@nussman.us>

* change: [M3-8857] - Update PULL_REQUEST_TEMPLATE (Part 2) (linode#11236)

* Make updates discussed to PR template during retro

* Add changeset

---------

Co-authored-by: corya-akamai <136115382+corya-akamai@users.noreply.github.com>
Co-authored-by: Alban Bailly <130582365+abailly-akamai@users.noreply.github.com>
Co-authored-by: Hana Xu <115299789+hana-akamai@users.noreply.github.com>
Co-authored-by: Harsh Shankar Rao <hrao@akamai.com>
Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>
Co-authored-by: rodonnel-akamai <rodonnel@akamai.com>
Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com>
Co-authored-by: Banks Nussman <banks@nussman.us>
Co-authored-by: venkatmano-akamai <chk-Venkatesh@outlook.com>
Co-authored-by: vmangalr <vmangalr@akamai.com>
Co-authored-by: Connie Liu <139280159+coliu-akamai@users.noreply.github.com>
Co-authored-by: Hussain Khalil <122488130+hkhalil-akamai@users.noreply.github.com>
Co-authored-by: hasyed-akamai <hasyed@akamai.com>
Co-authored-by: Purvesh Makode <pmakode@akamai.com>
Co-authored-by: ankitaakamai <ankitaan@akamai.com>
Co-authored-by: mpolotsk-akamai <157619599+mpolotsk-akamai@users.noreply.github.com>
Co-authored-by: Talmai Oliveira <to@talm.ai>
Co-authored-by: Talmai Oliveira <toliveir@akamai.com>
Co-authored-by: John Callahan <114753608+jcallahan-akamai@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: jdamore-linode <97627410+jdamore-linode@users.noreply.github.com>
Co-authored-by: Hana Xu <hxu@akamai.com>
  • Loading branch information
1 parent 15fd616 commit 2887f18
Show file tree
Hide file tree
Showing 501 changed files with 2,659 additions and 2,642 deletions.
61 changes: 41 additions & 20 deletions docs/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
## Description 📝

Highlight the Pull Request's context and intentions.

## Changes 🔄
List any change relevant to the reviewer.

List any change(s) relevant to the reviewer.

- ...
- ...

## Target release date 🗓️
Please specify a release date to guarantee timely review of this PR. If exact date is not known, please approximate and update it as needed.

Please specify a release date (and environment, if applicable) to guarantee timely review of this PR. If exact date is not known, please approximate and update it as needed.

## Preview 📷

**Include a screenshot or screen recording of the change.**

:lock: Use the [Mask Sensitive Data](https://cloud.linode.com/profile/settings) setting for security.
Expand All @@ -23,38 +28,53 @@ Please specify a release date to guarantee timely review of this PR. If exact da
## How to test 🧪

### Prerequisites

(How to setup test environment)

- ...
- ...

### Reproduction steps

(How to reproduce the issue, if applicable)
- ...
- ...

- [ ] ...
- [ ] ...

### Verification steps

(How to verify changes)
- ...
- ...

## As an Author I have considered 🤔
- [ ] ...
- [ ] ...

## As an Author, I have considered 🤔

*Check all that apply*
- 👀 Doing a self review
- ❔ Our [contribution guidelines](https://github.com/linode/manager/blob/develop/docs/CONTRIBUTING.md)
- 🤏 Splitting feature into small PRs
- ➕ Adding a [changeset](https://github.com/linode/manager/blob/develop/docs/CONTRIBUTING.md#writing-a-changeset)
- 🧪 Providing/improving test coverage
- 🔐 Removing all sensitive information from the code and PR description
- 🚩 Using a feature flag to protect the release
- 👣 Providing comprehensive reproduction steps
- 📑 Providing or updating our documentation
- 🕛 Scheduling a pair reviewing session
- 📱 Providing mobile support
- ♿ Providing accessibility support

- [ ] 👀 Doing a self review
- [ ] ❔ Our [contribution guidelines](https://github.com/linode/manager/blob/develop/docs/CONTRIBUTING.md)
- [ ] 🤏 Splitting feature into small PRs
- [ ] ➕ Adding a [changeset](https://github.com/linode/manager/blob/develop/docs/CONTRIBUTING.md#writing-a-changeset)
- [ ] 🧪 Providing/Improving test coverage
- [ ] 🔐 Removing all sensitive information from the code and PR description
- [ ] 🚩 Using a feature flag to protect the release
- [ ] 👣 Providing comprehensive reproduction steps
- [ ] 📑 Providing or updating our documentation
- [ ] 🕛 Scheduling a pair reviewing session
- [ ] 📱 Providing mobile support
- [ ] ♿ Providing accessibility support
<br/>

- [ ] I have read and considered all applicable items listed above.

## As an Author, before moving this PR from Draft to Open, I confirmed ✅

- [ ] All unit tests are passing
- [ ] TypeScript compilation succeeded without errors
- [ ] Code passes all linting rules

---

## Commit message and pull request title format standards

> **Note**: Remove this section before opening the pull request
Expand All @@ -63,6 +83,7 @@ Please specify a release date to guarantee timely review of this PR. If exact da
`<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.
Expand Down
45 changes: 26 additions & 19 deletions docs/development-guide/08-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,38 @@ The unit tests for Cloud Manager are written in Typescript using the [Vitest](ht

To run tests, first build the **api-v4** package:

```
```shell
yarn install:all && yarn workspace @linode/api-v4 build
```

Then you can start the tests:

```
```shell
yarn test
```

Or you can run the tests in watch mode with:

```
```shell
yarn test:watch
```

To run a specific file or files in a directory:

```
```shell
yarn test myFile.test.tsx
yarn test src/some-folder
```

Vitest has built-in pattern matching, so you can also do things like run all tests whose filename contains "Linode" with:

```
```shell
yarn test linode
```

To run a test in debug mode, add a `debugger` breakpoint inside one of the test cases, then run:

```
```shell
yarn workspace linode-manager run test:debug
```

Expand All @@ -64,31 +64,25 @@ describe("My component", () => {
Handling events such as clicks is a little more involved:

```js
import { fireEvent } from "@testing-library/react";
import { userEvent } from '@testing-library/user-event';
import { renderWithTheme } from "src/utilities/testHelpers";
import Component from "./wherever";

const props = { onClick: vi.fn() };

describe("My component", () => {
it("should have some text", () => {
it("should have some text", async () => {
const { getByText } = renderWithTheme(<Component {...props} />);
const button = getByText("Submit");
fireEvent.click(button);
await userEvent.click(button);
expect(props.onClick).toHaveBeenCalled();
});
});
```

If, while using the Testing Library, your tests trigger a warning in the console from React ("Warning: An update to Component inside a test was not wrapped in act(...)"), first check out the library author's [blog post](https://kentcdodds.com/blog/fix-the-not-wrapped-in-act-warning) about this. Depending on your situation, you probably will have to `wait` for something in your test:

```js
import { fireEvent, wait } from '@testing-library/react';
We recommend using `userEvent` rather than `fireEvent` where possible. This is a [React Testing Library best practice](https://testing-library.com/docs/user-event/intro#differences-from-fireevent), because `userEvent` more accurately simulates user interactions in a browser and makes the test more reliable in catching unintended event handler behavior.

...
await wait(() => fireEvent.click(getByText('Delete')));
...
```
If, while using the Testing Library, your tests trigger a warning in the console from React ("Warning: An update to Component inside a test was not wrapped in act(...)"), first check out the library author's [blog post](https://kentcdodds.com/blog/fix-the-not-wrapped-in-act-warning) about this. Depending on your situation, you probably will have to use [`findBy`](https://testing-library.com/docs/dom-testing-library/api-async/#findby-queries) or [`waitFor`](https://testing-library.com/docs/dom-testing-library/api-async/) for something in your test to ensure asynchronous side-effects have completed.

### Mocking

Expand All @@ -108,7 +102,9 @@ vi.mock('@linode/api-v4/lib/kubernetes', async () => {

Some components, such as our ActionMenu, don't lend themselves well to unit testing (they often have complex DOM structures from MUI and it's hard to target). We have mocks for most of these components in a `__mocks__` directory adjacent to their respective components. To make use of these, just tell Vitest to use the mock:

```js
vi.mock('src/components/ActionMenu/ActionMenu');
```

Any `<ActionMenu>`s rendered by the test will be simplified versions that are easier to work with.

Expand Down Expand Up @@ -157,6 +153,7 @@ We use [Cypress](https://cypress.io) for end-to-end testing. Test files are foun
* Select a reasonable expiry time (avoid "Never") and make sure that every permission is set to "Read/Write".
3. Set the `MANAGER_OAUTH` environment variable in your `.env` file using your new personal access token.
* Example of `.env` addition:

```shell
# Manager OAuth token for Cypress tests:
# (The real token will be a 64-digit string of hexadecimals).
Expand All @@ -174,16 +171,19 @@ We use [Cypress](https://cypress.io) for end-to-end testing. Test files are foun
Cloud Manager UI tests can be configured using environment variables, which can be defined in `packages/manager/.env` or specified when running Cypress.

##### Cypress Environment Variables

These environment variables are used by Cypress out-of-the-box to override the default configuration. Cypress exposes many other options that can be configured with environment variables, but the items listed below are particularly relevant for Cloud Manager testing. More information can be found at [docs.cypress.io](https://docs.cypress.io/guides/guides/environment-variables).

| Environment Variable | Description | Example | Default |
|----------------------|--------------------------------------------|----------------------------|-------------------------|
| `CYPRESS_BASE_URL` | URL to Cloud Manager environment for tests | `https://cloud.linode.com` | `http://localhost:3000` |

##### Cloud Manager-specific Environment Variables

These environment variables are specific to Cloud Manager UI tests. They can be distinguished from out-of-the-box Cypress environment variables by their `CY_TEST_` prefix.

###### General

Environment variables related to the general operation of the Cloud Manager Cypress tests.

| Environment Variable | Description | Example | Default |
Expand All @@ -192,6 +192,7 @@ Environment variables related to the general operation of the Cloud Manager Cypr
| `CY_TEST_TAGS` | Query identifying tests that should run by specifying allowed and disallowed tags. | `method:e2e` | Unset; all tests run by default |

###### Overriding Behavior

These environment variables can be used to override some behaviors of Cloud Manager's UI tests. This can be useful when testing Cloud Manager for nonstandard or work-in-progress functionality.
| Environment Variable | Description | Example | Default |
Expand All @@ -200,6 +201,7 @@ These environment variables can be used to override some behaviors of Cloud Mana
| `CY_TEST_FEATURE_FLAGS` | JSON string containing feature flag data | `{}` | Unset; feature flag data is not overridden |
###### Run Splitting
These environment variables facilitate splitting the Cypress run between multiple runners without the use of any third party services. This can be useful for improving Cypress test performance in some circumstances. For additional performance gains, an optional test weights file can be specified using `CY_TEST_SPLIT_RUN_WEIGHTS` (see `CY_TEST_GENWEIGHTS` to generate test weights).
| Environment Variable | Description | Example | Default |
Expand All @@ -210,6 +212,7 @@ These environment variables facilitate splitting the Cypress run between multipl
| `CY_TEST_SPLIT_RUN_WEIGHTS` | Path to test weights file | `./weights.json` | Unset; disabled by default |
###### Development, Logging, and Reporting
Environment variables related to Cypress logging and reporting, as well as report generation.
| Environment Variable | Description | Example | Default |
Expand All @@ -222,6 +225,7 @@ Environment variables related to Cypress logging and reporting, as well as repor
| `CY_TEST_GENWEIGHTS` | Generate and output test weights to the given path | `./weights.json` | Unset; disabled by default |
###### Performance
Environment variables that can be used to improve test performance in some scenarios.
| Environment Variable | Description | Example | Default |
Expand All @@ -233,6 +237,7 @@ Environment variables that can be used to improve test performance in some scena
1. Look here for [Cypress Best Practices](https://docs.cypress.io/guides/references/best-practices)
2. Test Example:
```tsx
/* this test will not pass on cloud manager.
it is only intended to show correct test structure, syntax,
Expand Down Expand Up @@ -293,13 +298,15 @@ Environment variables that can be used to improve test performance in some scena
});
});
```
3. How to use intercepts:
```tsx
// stub response syntax:
cy.intercept('POST', ‘/path’, {response}) or cy.intercept(‘/path’, (req) => { req.reply({response})}).as('something');
// edit and end response syntax:
// edit and end response syntax:
cy.intercept('GET', ‘/path’, (req) => { req.send({edit: something})}).as('something');
// edit request syntax:
// edit request syntax:
cy.intercept('POST', ‘/path’, (req) => { req.body.storyName = 'some name'; req.continue().as('something');
// use alias syntax:
Expand Down
5 changes: 0 additions & 5 deletions packages/api-v4/.changeset/pr-11152-added-1729713487291.md

This file was deleted.

This file was deleted.

5 changes: 5 additions & 0 deletions packages/api-v4/.changeset/pr-11178-added-1730961405650.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/api-v4": Added
---

Extend support for Object Storage in Support tickets ([#11178](https://github.com/linode/manager/pull/11178))

This file was deleted.

19 changes: 19 additions & 0 deletions packages/api-v4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## [2024-11-12] - v0.130.0


### Added:

- DBaaS: Suspend and Resume backend calls ([#11152](https://github.com/linode/manager/pull/11152))

### Removed:

- DBaaS: Deprecated types including MongoDB and Redis ([#11218](https://github.com/linode/manager/pull/11218))

### Tech Stories:

- Remove `@types/node` dependency ([#11157](https://github.com/linode/manager/pull/11157))

### Upcoming Features:

- DBaaS: Modify update payload to include version, add patch API ([#11196](https://github.com/linode/manager/pull/11196))


## [2024-10-28] - v0.129.0

Expand Down
2 changes: 1 addition & 1 deletion 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.129.0",
"version": "0.130.0",
"homepage": "https://github.com/linode/manager/tree/develop/packages/api-v4",
"bugs": {
"url": "https://github.com/linode/manager/issues"
Expand Down
Loading

0 comments on commit 2887f18

Please sign in to comment.