Commit graph

90 commits

Author SHA1 Message Date
regexowl
a2ad644fb9 test: Edit mode tests for repositories
This adds a new 'repositories' fixture to the blueprints as was done for 'oscap'.

Newly added unit tests check that repositories get parsed from and back to request correctly and that when removing previously used repositories an 'Are you sure?' modal pops up.
2024-06-12 16:05:30 +02:00
Ondřej Budai
642cb10036 drop centos stream 8
CentOS Stream 8 is EOL, thus we should no longer offer it in the
service, because it can pose a security risk.

See https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/
2024-06-12 10:07:33 +02:00
regexowl
a23cc9321b test: Update tests after adding SaveAndBuild modal
This updates tests with a `openAndDismissSaveAndBuildModal` function that handles closing the SaveAndBuild modal after clicking on Create blueprint for the first time.
2024-06-06 16:58:59 +02:00
regexowl
45a42ce549 src: Migrate remaining files to TypeScript
This migrates remaining JavaScript files to TypeScript and updates imports.
2024-06-06 08:38:41 +02:00
regexowl
67138ad99a V2Wizard: Add tests for WSL/OpenSCAP behaviour
This adds two new tests:
- test that alert is rendered and OpenSCAP dropdown is disabled for WSL target only
- test that alert is rendered, but OpenSCAP dropdown is still enabled for target list that includes WSL
2024-06-05 17:04:14 +02:00
Andrew Dewar
5dc4ecb63f HMS-4024: Update repositories step 2024-06-04 14:05:44 +02:00
Amir
913a7d6406 WizardV2: fix google account typo 2024-05-27 09:42:13 +02:00
regexowl
12fc6b9841 V2Wizard: Set pkg recommendations expandable to open by default
This makes the pkg recommendations expandable open by default and updates the tests accordingly.
2024-05-22 16:48:11 +02:00
regexowl
f37bd91a9a test: Update tests after TypeScript migration
This resolves problems caused by TypeScript migration.
2024-05-03 16:36:26 +02:00
regexowl
6415664620 test: Replace 'rhel-94' with a constant
This replaces 'rhel-94' with a RHEL_9 constant in the tests.
2024-05-03 08:48:00 +02:00
regexowl
034843a708 src: Add rhel-94
This adds rhel94.
2024-05-02 16:44:33 +02:00
Amir
6f9c4f3864 feat(HMS-3582): add first boot step to wizard 2024-05-02 16:35:26 +02:00
Andrew Dewar
f9aae48dd1 Wizard V2: Packages refactor, recommendations fix. 2024-05-02 15:17:08 +03:00
regexowl
df9ec1499d V2Wizard: Fix FSC units on Edit
This updates the logic of parsing bytesize into size/unit pair.

Currently 'GiB' is set as a default which causes problem with smaller partitions on Edit.

A validation for the min_size is in place and the rule is that the size cannot be smaller than 0 of a given unit. If there was a partition with smaller size in KiB it will break the rule when converted to GiB.
2024-05-01 19:47:41 +02:00
lucasgarfield
61b23216f4 V2 Wizard: OpenSCAP edit tests
Edit mode is now fully tested and working for OpenSCAP profiles. A
handler for the PUT request was added and the fixtures were updated to
support this.

`EditImageWizard.tsx`: Previously we dispatched `initializeWizard()`
while waiting for the blueprintDetails to load. This meant that the
state was incorrect (empty) while the blueprintDetails request was
in flight.

`requestMapper.tsx`: Correctly populate state in edit mode if the
blueprint contains a custom file system – previously custom mountpoints
were dropped and automatic mode was selected.

`spyOnRequest()`: Differentiate between request types (e.g. GET, PUT)
for the same endpoint.
2024-04-30 15:13:50 +02:00
regexowl
0c1af145c1 test: Add tests to check reseting public cloud states
This adds happy path tests that check whether the public cloud states get reset after the public cloud was removed from targets.
2024-04-29 15:35:59 +02:00
regexowl
6494070a40 test: Replace image installer with guest image in happy path tests
This replaces 'image-installer' target with 'guest-image' in happy path tests which allows proper testing of FSC functionality. File system customisations are not applied to bare metal - installer images.
2024-04-29 11:57:30 +02:00
regexowl
ec8cf1c8b9 test: Add test for checking ISO only / more targets FSC options
This adds two tests that check whether the "Manually configure partitions" options is hidden on ISO only target and shown when combined with another target.
2024-04-29 11:57:30 +02:00
lucasgarfield
bb91840eef V2 Wizard: Fix snapshot_date field
The snapshot_date in the image_request must be a date. snapshot_date is
an optional field and if no snapshot is used, the field should be
undefined. Previously it was an empty string and this caused image
builder to return a code 400 with message "Snapshot date is not in
DateOnly (yyyy-mm-dd) format".
2024-04-26 15:03:17 +02:00
Ondrej Ezr
7246cfbd16 WizardV2: pass module_hotfixes to the request 2024-04-26 13:59:20 +02:00
Andrew Dewar
3231b324f0 HMS-3796: Add snapshot date selection to wizard 2024-04-25 14:45:50 +02:00
regexowl
b6041d2022 V2Wizard: Add masked services to the "Disabled services" code block
Fixes #1985

This concatenates masked service to the disabled services so both get rendered in the "Disabled service" code block.

Test to check this was also added.
2024-04-25 11:40:17 +02:00
regexowl
45be93db11 test: Add debounce to tests
Extra await with longer time out was added to a test to accomodate searchTerm debounce.
2024-04-25 11:32:47 +02:00
regexowl
3b7a1338ec test: Add unleash flag mocking to the tests
The functionality is currently gated behind an unleash flag. This adds the mocked flag to the tests.
2024-04-25 11:22:08 +02:00
regexowl
6f6784df2d test: Add package recommendations to the happy path test
This adds unit tests for package recommendations to the `Packages.test.tsx`, testing the happy path for:
- adding single recommendation
- adding all recommendations
- removing a recommendation
2024-04-25 11:22:08 +02:00
regexowl
371588e9a2 test: Add tests for package recommendations
This updates the handlers and fixtures and adds a simple unit test testing that recommendations get rendered correctly and it's possible to add them to the blueprint.
2024-04-25 11:22:08 +02:00
lucasgarfield
1607fda162 V2 Wizard: Add Azure tests (HMS-2781)
Adds tests to verify that building an Azure image using either sources
or manually entering the required info results in a correctly generated
request.
2024-04-23 11:58:42 +02:00
lucasgarfield
1367de0684 V2 Wizard: Add AWS tests (HMS-2781)
Adds tests to verify that building an AWS image using either sources or
an account id results in a correctly generated request.
2024-04-23 10:40:31 +02:00
lucasgarfield
a1bdcaa54f V2 Wizard: Fix OpenSCAP step
OpenSCAP profile info is now correctly loaded into the state and
verified to be in the final request with tests.

I modified the fixtures for the OpenSCAP profiles. My changes ensure we
have a Venn-diagram like overlap when changing from one profile to
another where one package is the same, one package is removed, and one
package is added. The same is true for the services and partitions. For
kernel args it is not so important as that is just a string (as opposed
to an array), so it is enough to be different.

I was able to eliminate a useEffect by replacing it with a lazy query
trigger function. Setting the second arg `preferCacheValue` to `true`
means that a request is only made if cached data is not available.

I modified the Redux reducers a bit to add some additional safety.

`changeFileSystemPartitionMode` is now responsible for initializing the
partitions field in the state by adding the root partition – previously
this was done in the components themselves by dispatching
`addPartition`. This reducer can always be safely dispatched – if the
mode is ‘manual’, dispatching it with a payload of ‘manual’ will not
result in any changes to the state.

`addPackage` is also safer now. When a package is added, the list of
packages is checked. If there is a package with an identical name, the
new package overwrites the previous package. This is useful because the
description may be different for the same package – for instance, when
adding an OpenSCAP package, we use a custom description (‘this package
required by OpenSCAP’).
2024-04-23 10:02:03 +02:00
Amir
bac8e1e57f V2Wizard: add GCP target full test coverage 2024-04-18 18:51:40 +02:00
regexowl
dbeee5d066 V2Wizard: Differentiate between Create and Edit mode on Review step
This renames actions on the primary button on Review step for the Create mode so it's clear whether you're creating a blueprint from a scratch or saving changes to an already existing blueprint.
2024-04-17 18:46:49 +03:00
lucasgarfield
782a8eba7e V2 Wizard: Add custom file system to request customizations (HMS-3690)
The blueprint request now contains a field for the filesystem in its
customizations.
2024-04-16 10:02:19 +02:00
regexowl
43cb43dac8 V2Wizard: Add tally to the "Selected" toggle
This adds a tally of selected packages to the "Selected" toggle.
2024-04-11 11:41:46 +02:00
regexowl
a8270fd228 test: Re-enable FSC alert test and clean up
This re-enables test of FSC alert and cleans up previously commented lines of the tests.
2024-04-11 11:21:19 +02:00
regexowl
972190ecaf V2Wizard: Update create/edit button copy
This updates copy on the Save changes button as per recent mocks.
2024-04-10 13:44:22 +03:00
Amir
442d88a4ce fix(HMS-3850): V2Wizard:use menu toggle for save and build 2024-04-09 14:56:34 +02:00
regexowl
7e83c8ecbb test: Enable OpenSCAP initialized packages tests
This re-enables tests checking initialization of packages upon OpenSCAP profile selection.
2024-04-04 12:34:57 +02:00
regexowl
f71175f69b V2Wizard: Add full bottom pagination to Repositories and Packages
This adds full pagination to the bottom of Repositories and Packages steps which will allow the user to get to the very end of the tables in a case of many results.
2024-04-04 11:35:07 +02:00
regexowl
d2c56391f9 V2Wizard: Update "Too many results" copy
This updates copy shown in a table when too many results are fetched. Also a period was added to the end of the empty state bodies.
2024-04-02 10:59:41 +02:00
Ondrej Ezr
ad8fd5ddc3 Blueprint: Validate Blueprint name is not empty
We are now validating Blueprint name on the backend to be non-empty.
Adds same validation for frontend

Refs HMS-3801
2024-03-25 12:51:33 +01:00
Gianluca Zuccarelli
d57cd95c65 V1Wizard: masked services -> disabled services
For the UX the user doesn't really need to know that the services are masked,
rather than disabled in the backend. We can simplify this and show the masked
services as disabled.
2024-03-21 11:16:50 +01:00
lucasgarfield
5dcc3abbd8 V2Wizard: Change search parameter from qcow to qcow2
`target=qcow2` is in better alignment with the UI than `target=qcow`
2024-03-20 18:04:44 +01:00
regexowl
a7cc88af44 V2Wizard: Add search parameter for target selection (HMS-3684)
Add an optional search parameter to the wizard like so:

`/insights/image-builder/imagewizard?target=iso`
or
`/insights/image-builder/imagewizard?target=qcow`

This results in wizard being opened and iso or qcow target being pre-selected. The Insights assistant chat bot will make use of this feature.
2024-03-20 18:04:44 +01:00
Simon Steinbeiss
ad25c6bcb7 V2 Wizard: Add search parameter for arch selection
Add an optional search parameter to the wizard like so:

/insights/image-builder/imagewizard?arch=aarch64

This results in the wizard being opened and 'aarch64' being pre-selected as the architecture.
The Insights assistant chat bot and our websites (access.redhat.com and
developers.redhat.com) will make use of this feature.

Relates to HMS-3684
2024-03-15 12:22:07 +01:00
mgold1234
430ea83df0 V2 Wizard: Add File System Configuration Step (HMS-2781)
The FSC step is added to the wizard and takes full advantage of Redux
for state management.

This is still a work in progress.

Supported features:
1. Select partition mountpoint prefix (e.g. /var, /home)
2. Edit partition mountpoint suffix (e.g. /home/videogames)
3. Change displayed units (KiB, MiB, GiB)

Supported but buggy features:
1. Edit partition size

Unsupported features:
1. Add partitions
2. Remove partitions
3. Validation
2024-03-08 18:14:33 +01:00
lucasgarfield
6af38141be V2 Wizard Tests: Add tests for release and architecture
Adds tests that ensure the blueprint request is generated correctly for
all releases (rhel 8 & 9, centos 8 & 9) and for both architectures
(x86_64 and aarch64).
2024-03-07 17:03:20 +01:00
lucasgarfield
d6016519e5 Test: useChrome() mocks isBeta() returns true
The previous commit adjusts the necessary feature flags to expose the
new blueprints table and V2 wizard in stage-preview.

This causes tests where isBeta() == false to fail. This commit changes
the relevant useChrome() mocks such that isBeta() returns true.
2024-03-05 19:27:46 +01:00
lucasgarfield
25a5ff7772 V2Wizard/Test: Add docstring to preparePathname helper
preparePathname() is called by the render() test helper function, this
commit adds a docstring (JSDoc format) with examples to document how it
works.
2024-03-04 16:43:55 +01:00
lucasgarfield
ad5d2007bb V2 Wizard: Add search parameter for release selection (HMS-3684)
Adding an optional search parameter to the V2 wizard like so:

/insights/image-builder/imagewizard?release=rhel8

results in the wizard being opened and RHEL 8 being pre-selected as the release.

The Insights assistant chat bot will make use of this feature.

The render() test utility function had to be updated to accept an
optional searchParams argument.
2024-03-04 16:43:55 +01:00
regexowl
c60e45cd4d test: Remove "Click through all"
This removes the "Click through all" test as it will be replaces by testing the requests for separate customisations.
2024-03-04 16:33:24 +01:00