Commit graph

1303 commits

Author SHA1 Message Date
regexowl
d3eaccc636 test: Fix "Unnecessary escape character" error
This fixes an error triggered by the no-useless-escape rule.
2023-11-08 14:15:17 +01:00
regexowl
7b0b9a8ddc test: Fix await-async-events error
After cleaning up the ESLint plugins a new error for eslint-plugin-testing-library popped up. This PR solves all of the occurences of `Promise returned from async event method `user` must be handled` and removes the `"testing-library/await-async-events": "off"` switch which was temporary put in place.
2023-11-08 14:15:17 +01:00
regexowl
2687312f16 ESLint: Update rules after removing eslint-config-react-app
This updates rules for linting both JS and TS files in a way that is consistent with previous linting.

Some rules for linting TS files were turned off or switched to warnings for now.
2023-11-08 14:15:17 +01:00
regexowl
1f6f14caec devDeps: Remove eslint-config-react-app dependency
A dependabot PR https://github.com/RedHatInsights/image-builder-frontend/pull/1394 was failing with the following message:
"ESLint couldn't determine the plugin "testing-library" uniquely."

This was caused by having two separate instances of "eslint-plugin-testing-library" in dependencies. One directly in the `devDependencies` and another one as a dependency of eslint-config-react-app.

Seeing as [eslint-config-react-app](https://www.npmjs.com/package/eslint-config-react-app) was not updated in the last two years, the majors versions of deps in the "bundle" were crashing with the `devDependencies` one.
2023-11-08 14:15:17 +01:00
dependabot[bot]
651d764c01 build(deps-dev): bump @types/jest from 29.5.5 to 29.5.7
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.5 to 29.5.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-07 12:11:51 +01:00
regexowl
1fd8deec1a ImagesTable: Add expiring/expired status to OCI images
Pre-authenticated requests for the OCI images expire 7 days after creation. This adds "Expires in <x> days" and "Expired" as possible statuses for the OCI images.
2023-11-07 11:13:28 +01:00
regexowl
7ec87dfa58 fixtures: Add OCI images to the mock fixtures
This adds an expired mock OCI image with an ID "0c1ec8d8-be39-47f2-9bd4-a3fff8244fce" and an expiring mock OCI image with an ID "ea23cfd6-fd8b-43ed-adfc-9f76bb8487ef".
2023-11-07 11:13:28 +01:00
regexowl
b8372eeaf5 ImagesTable: Add OCI images
This adds a row for OCI images in the ImagesTable. Details about the images show UUID of the image and the Object Storage URL which is needed to deploy the image.

"Image link" button in the Instance column contains instrucion on how to run an OCI image built by Image Builder in Oracle Cloud. The documentation link in the popover is just a placeholder for now as the documentation is being prepared.

Until the build is finished the "Image link" button is disabled as it would be missing the Object Storage URL which is creating on upload.
2023-11-07 11:13:28 +01:00
regexowl
fd61cd135b Wizard: Add the option of building OCI images to the Wizard
This adds a tile allowing to build an OCI image to the Image output step of the wizard. The tile is only visible in the Preview.

As there are no other customer information needed for the build, no addiional step for OCI was added.

Review step was also updated to include OCI images.
2023-11-07 11:13:28 +01:00
regexowl
de30c6c637 store: Update api schema
This updates the api schema to the newest version and also adds `isOciUploadStatus` to the type guards.
2023-11-07 11:13:28 +01:00
dependabot[bot]
f1762e91d9 build(deps-dev): bump @types/react from 18.2.23 to 18.2.36
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.2.23 to 18.2.36.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-07 09:07:24 +01:00
mgold1234
72d605c96b add region name to new region message
FIX # https://github.com/RedHatInsights/image-builder-frontend/issues/1410
this commit add region name when user share to new region for image
2023-11-06 16:51:44 +01:00
dependabot[bot]
014f14546c build(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.7.3 to 6.9.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 10:28:06 +01:00
dependabot[bot]
85131cf602 build(deps-dev): bump @babel/core from 7.22.10 to 7.23.2
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.22.10 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/@babel/core@7.23.2/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 08:58:05 +01:00
dependabot[bot]
a3b64e5e0c build(deps): bump @patternfly/patternfly from 4.224.2 to 5.1.0
Bumps [@patternfly/patternfly](https://github.com/patternfly/patternfly) from 4.224.2 to 5.1.0.
- [Release notes](https://github.com/patternfly/patternfly/releases)
- [Changelog](https://github.com/patternfly/patternfly/blob/main/release.config.js)
- [Commits](https://github.com/patternfly/patternfly/compare/prerelease-v4.224.2...v5.1.0)

---
updated-dependencies:
- dependency-name: "@patternfly/patternfly"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 14:08:14 +01:00
dependabot[bot]
5de653e1e3 build(deps-dev): bump @testing-library/dom from 9.3.1 to 9.3.3
Bumps [@testing-library/dom](https://github.com/testing-library/dom-testing-library) from 9.3.1 to 9.3.3.
- [Release notes](https://github.com/testing-library/dom-testing-library/releases)
- [Changelog](https://github.com/testing-library/dom-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/dom-testing-library/compare/v9.3.1...v9.3.3)

---
updated-dependencies:
- dependency-name: "@testing-library/dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 13:23:48 +01:00
regexowl
6a19aae96c ImagesTable: Fix padding of disabled download links
This fixes an uneven padding for disabled "Download (....)" links.
2023-11-02 12:33:42 +01:00
regexowl
5553766415 workflows: Add a workflow with dev checks
As Travis CI is getting removed from RedHatInsights this should replace it in what we used to use Travis for.

This workflow is triggered on pull requests to main and runs clean install of dependencies, lint check and the unit test suite.

The main motivation of this workflow being separated from the IQE tests is to allow to quickly check if the basic tests pass during development without the need to wait for the IQE tests to finish their run.
2023-11-02 11:28:44 +01:00
Ondřej Ezr
9be2ceaba7 Remove sync branches script
With serving UI assets from containers, there is no need to sync branches anymore.
2023-10-31 10:34:09 +01:00
Jakub Rusz
f01904302a
Update terraform SHA (#1403)
We need a newer centos-8 image in our CI.
2023-10-31 07:53:28 +00:00
Thomas Lavocat
7a22d623e8 tests: add a unit test for the targetEnv
This new test is complementing the integration testing found in
src/test/Components/CreateImageWizars.*.test.js.

This new test makes sure that the logic within the component itself is
sound without taking care of interacting with other parts of the wizard.
It allows to test more combinations without worrying about combinatory
effects.

Refs HMS-1135
2023-10-26 20:07:54 +02:00
Thomas Lavocat
e2c3ea98b3 tests: there's now two option-menu to select from
Adding a new select into the images output step had for effet to
mechanically add a new option menu. In order to select the release
menu we have to take now the first option menu of all possibilities.

Refs HMS-1135
2023-10-26 20:07:54 +02:00
Thomas Lavocat
826882d1ef tests: adapt to target appearing dynamically
There is now a delay between when the user clicks on the architecture
button (or just goes onto the step) and when the targets are being
displayed. This is due to the fact that the data to filter which targets
needs to be displayed has to be fetched from the backend. And during the
meantime a loading spinner is shown.

To adapt to this the code simply waits for the fields to be accessible.

Refs HMS-1135
2023-10-26 20:07:54 +02:00
Thomas Lavocat
938340b360 wizard: allow the creation of aarch64 images
This commit extends the supported architectures to aarch64. In the image
output step (the first one of the wizard) the user is now faced with a
new select choices to pickup the architecture they want to build.

Now the set of compatible targets to build is dynamically loaded from
the backend and the UX changes what's accessible on the fly depending on
what's the user has been selected.

Refs HMS-1135
2023-10-26 20:07:54 +02:00
mgold1234
d91727bf38 ImageTable: THEEDGE-3450 - add ignoreImageType to getComposes endpoint
this commit adds filter for image_type to the getComposes endpoint,
enhancing the functionality of the Image Builder frontend table, which comprises two tabs: RPM and OSTree.
With this enhancement, users can now filter OSTree images from the RPM tab, preventing duplication.
2023-10-26 15:53:31 +02:00
Jakub Rusz
0b0e732624 pr_check: change marker and increase timeout
I have set up a new marker "fe_pr_check" to select tests for the
pr_check here. I'm also increasing the timeout of the CJI pod.
2023-10-26 15:08:01 +02:00
jkozol
84773b1c44 package.json: bump ddf version to fix wizard step numbering 2023-10-25 09:02:47 +02:00
jkozol
4e3e154f08 test: add awaits to user click in table's error test 2023-10-25 09:02:47 +02:00
jkozol
21298f4047 Wizard: fix mountpoint select 2023-10-25 09:02:47 +02:00
jkozol
3dd2accb1d Wizard: remove nav horizontal scroll 2023-10-25 09:02:47 +02:00
jkozol
751b393fea Wizard: fix dual list selector styling 2023-10-25 09:02:47 +02:00
lucasgarfield
854ff4a8eb Wizard: Fix file system customization form inputs
Upgrading to PF5 caused the inputs on the file system customization
inputs to stack on each other.

This commit makes them appear in-line again by using the `<Grid>`
component.

Inspiration taken from this PF5 example:
https://www.patternfly.org/components/forms/form#grid-form
2023-10-25 09:02:47 +02:00
jkozol
cf1d477544 ShareImageModal: update the typeahead selector to pf5
This dropdown needed to be update as part of the overall pf5 upgrade.
Each of the components in the select now need to be declared and
handled. Also, some of the Select and SelectOption props come from the
Menu props since Select inherits Menu.
2023-10-25 09:02:47 +02:00
jkozol
a5b1b1f775 package.json: upgrade patternfly to version 5
This upgrade requires multiple package updates. There are many style
updates to reflect pf5's syntax and structure changes
2023-10-25 09:02:47 +02:00
lucasgarfield
c4d411efa4 Wizard: Improve in-page wizard cosmetically
This commit:
1. Removes the header from the Data Driven Forms wizard
2. Adds padding around the in-page wizard so it is visually consistent
   with the images table
3. Refactors the images table header into a re-usable component that is
   now used in both the images table and the wizard
4. Allows the repositories table to fill the available vertical space in
   the wizard
5. Adjusts the package dual list selectors so that they fill the
   available horizontal space in the wizard
2023-10-20 15:51:03 +02:00
Thomas Lavocat
1c1290f7ed oscap: a policy isn't a profile
There was a mixup on our side between what is a profile and what is a
policy. Long story short, a policy a super set of rules including a
profile. For now the wizard is only able to apply profiles and no
policies on images. So let's fix the terminology there.
2023-10-20 10:46:02 +02:00
Thomas Lavocat
d60c6cb74b oscap: lock the wizard step behind a feature flag
The oscap feature have been quite eagerly pushed forward and it seems we
went a bit fast with it. To take more time and make sure all the
stakeholders agree on the way forward the decision was taken to put this
functionality behind a feature flag.

The two feature flags for both stage and prod are there:
* https://insights-stage.unleash.devshift.net/projects/default/features/image-builder.wizard.oscap.enabled (enabled on stage so we can test the feature)
* https://insights.unleash.devshift.net/projects/default/features/image-builder.wizard.oscap.enabled (disabled on prod)
2023-10-19 10:00:44 +02:00
Jakub Rusz
3984971a72 pr_check: Increase namespace reservation to 2h 2023-10-18 12:20:13 +02:00
dependabot[bot]
4fe4b9340b build(deps-dev): bump @babel/traverse from 7.22.10 to 7.23.2
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.10 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-17 09:24:33 +02:00
dependabot[bot]
6839596dca build(deps-dev): bump postcss-scss from 4.0.7 to 4.0.9
Bumps [postcss-scss](https://github.com/postcss/postcss-scss) from 4.0.7 to 4.0.9.
- [Changelog](https://github.com/postcss/postcss-scss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss-scss/compare/4.0.7...4.0.9)

---
updated-dependencies:
- dependency-name: postcss-scss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-17 09:05:42 +02:00
lucasgarfield
6a968f1521 deps: bump @data-driven-forms/react-form-renderer from 3.21.6 to 3.21.7
This version includes a bugfix for the wizard navigation bar.
2023-10-16 16:07:47 +02:00
lucasgarfield
89f1da11bf API: Move notification dispatch to Image Builder API slice
This commit moves the notification dispatching for creating composes and
clones into a more sensible location – the Image Builder API slice.

It is more sensible because it separates the logic of the React
component (the wizard or share images modal) from the logic of handling
the request life cycle (which is now handled entirely in the slice).

There is a subtle but significant change – a new request will be
dispatched for every request. This is the correct way to do things as it
is possible that some requests succeed, and that others fail. Insights
causes the notifications to stack on top of each other neatly, so there
is no UI problem.

To facilitate this, we also need to use use Promise.allSettled instead
of Promise.all.
2023-10-13 11:44:33 +02:00
Thomas Lavocat
b312e4a2a7 fsc: fix the oscap fs customizations
There was a bug preventing all the partitions required by an oscap
policy to show up in the fsc step. That bug was because the FSC
customizations were only accepted if they matched exactly the fix set of
base partitions directories.

So now there's a bit of string manipulation to avoid that but it's all
patched up.

fixes https://github.com/RedHatInsights/image-builder-frontend/issues/1385
2023-10-12 20:20:16 +02:00
Sanne Raymaekers
d706a7e5e2 ImagesTable: show error popover on s3 images
The error popover should be shown in case there's a reason for the
error. This is already the case for the other image types.
2023-10-12 15:24:55 +02:00
lucasgarfield
6e018ce7c8 API: Eliminate race condition in Image Builder API slice
The images table uses the useGetComposesQuery hook to fetch composes and
implement pagination. When this query is used, args are provided for the
offset and limit and a 'Compose' tag is provided for the query.

When a mutation is triggered (causing a POST request to be sent to the
`/compose` end point), the 'Compose' tag is invalidated which clears all
cached data from useGetComposesQuery hooks, which in turn causes the
table to refetch compose information.

If invalidating the `Compose` tag causes a refetch before the new compose
is available in image-builder, the result does not contain the new
compose and the table is not updated to include it.

This commit eliminates the race condition by waiting for the query to be
fulfilled before invalidating tags (and therefore before refetching the
data).

All of the above applies equally to the `cloneCompose` mutation, and its
race condition has also been eliminated.

This commit is loosely inspired by the RTK Query docs section on
pessimistic updates:
https://redux-toolkit.js.org/rtk-query/usage/manual-cache-updates#pessimistic-updates

Typescript complains about the type of the tags. It does not recognize
the tag types that are defined in the same enhanceEndpoint() function.
For now, we simply ignore the Typescript errors. There is some
discussion here: https://github.com/reduxjs/redux-toolkit/issues/1510
2023-10-12 08:41:59 +02:00
lucasgarfield
c73824cd22 eslint: Disabled rulesdir/forbid-pf-relative-imports
Commit #3e84abba3f bumped
@redhat-cloud-services/eslint-config-redhat-cloud-services from 1.3.0 to
2.0.3.

This introduced a new rule that broke a number of our imports. This
commit forbids the rule for now.

(rulesdir/forbid-pf-relative-imports: off)
2023-10-11 18:03:58 +02:00
Gianluca Zuccarelli
44e2a9519b devel: mv to osbuild/getting-started
Move the docker backend to the `getting-started` repo in `osbuild` since
it seems like a more appropriate place for the backend stack. Add a note
to the README to point users to the new repository.
2023-10-11 09:34:52 +02:00
jkozol
5a34506eb6 devel: update local containerized development
Update multiple aspects of our docker development stack. The frontend now
has a devel specific webpack that allows development against a local server/api.
The docker-composer.yaml also includes both versioning and networking updates.
Overall, the major change is to migrate our proxy access into the crc webpack proxy.
2023-10-11 09:34:52 +02:00
regexowl
51ad859747 test: Improve stability of the ImagesTable tests
This should help with tests flaking on the `act()` error.
2023-10-10 15:30:39 +02:00
Thomas Lavocat
cbe710e75e wizard: don't show the form as a modal
When the user clicks on the "create an image" button, the image wizard
shows up replacing the landing page. This allows to keep the quickstart
guides to the right of the wizard while the user is interacting with it.
2023-10-09 11:40:40 +02:00