Commit graph

1257 commits

Author SHA1 Message Date
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
dependabot[bot]
cd2d3c41f7 build(deps): bump postcss from 8.4.29 to 8.4.31
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.29 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.29...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-09 10:38:49 +02:00
Thomas Lavocat
382b0195da test: new set of tests for the compliance step
The compliance step is now tested with two new tests:
- One to test that upon creation, if a user selects a profile, then the
  customizations are applied to the file system and package steps
- One to test that upon recreation, the file system and packages
  customizations are still present.

HMS-2077
2023-10-06 16:26:09 +02:00
Thomas Lavocat
e8f454a579 packages: load the oscap profile when available
The packages list is now pre populated with the customization packages
asked by the oscap profile the user has selected.

HMS-2077
2023-10-06 16:26:09 +02:00
Thomas Lavocat
7c55190ac3 fsc: load the oscap profile when available.
When the user has selected a profile to customize their distribution,
the FSC step now shows immediately the manual configuration opened up
with the partitions coming from the profile already filled in.

If the user goes back to the Compliance step and changes anything, the
FSC step is going to be reinitialized.

HMS-2077
2023-10-06 16:26:09 +02:00
Thomas Lavocat
18cc74cf6b wizard: add oscap to the review step
The review step now list the OpenSCAP policy chosen by the user.
2023-10-06 16:26:09 +02:00
Thomas Lavocat
3e11639960 wizard: the oscap step is reserved for beta
Do not show the oscap step outside of beta. Only protecting the step
itself is sufficient since the FSC and the Packages steps wont load any
profile data if no entry point allows to get one.

HMS-2077

wizardrecreatebeta
2023-10-06 16:26:09 +02:00
Thomas Lavocat
02a642df19 oscap: add the compliance step to the wizard
This commit adds the Compliance step to the wizard. In this step the
user can select a policy from the list of available policies. Their
image is going to be updated with the necessary changes on the later
steps.

IB and The compliance endpoint are both returning the list of policies a
user has access to. The oscap step computes the intersection of the
policies accessible before showing the select list to the user.

HMS-2077
2023-10-06 16:26:09 +02:00
Thomas Lavocat
1587ead4d9 mocks: add oscap fixtures and handlers
In order to test the oscap customization profiles, let's declare new msw
data that can be used in unit testing.

HMS-2077
2023-10-06 16:26:09 +02:00
Thomas Lavocat
273aa52711 api: update to latest image builder
This will let the code access the new endpoints to get the OSCAP
profiles and OSCAP customizations for the images.

HMS-2077
2023-10-06 16:26:09 +02:00
lucasgarfield
67570b8e54 Revert "API: Add Compliance API slice"
This reverts commit 36f9e70565.

The Compliance v1 API is not stable and not intended for consumption by
other teams. We will implement the OpenSCAP MVP without the Compliance
API for now with a hard coded list of polices in image-builder, and when
their v2 API is ready in the near future begin using it to retrieve
policies.
2023-10-06 13:35:27 +02:00
dependabot[bot]
12d920f9b3 build(deps): bump react-router-dom from 6.15.0 to 6.16.0
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.15.0 to 6.16.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.16.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-05 15:47:52 +02:00
dependabot[bot]
551ff68515 build(deps-dev): bump @testing-library/jest-dom from 5.17.0 to 6.1.3
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.17.0 to 6.1.3.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.17.0...v6.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 13:49:06 +02:00
lucasgarfield
36f9e70565 API: Add Compliance API slice
This commit adds the Compliance service's API, which we can query for a
list of SCAP security policies.

In a follow-up PR, we will allow the user to optionally select a policy
when creating an image in the wizard.
2023-09-28 14:50:33 +02:00
dependabot[bot]
c7ef446fdb build(deps): bump @data-driven-forms/react-form-renderer
Bumps [@data-driven-forms/react-form-renderer](https://github.com/data-driven-forms/react-forms/tree/HEAD/packages/react-form-renderer) from 3.21.0 to 3.21.6.
- [Release notes](https://github.com/data-driven-forms/react-forms/releases)
- [Commits](https://github.com/data-driven-forms/react-forms/commits/v3.21.6/packages/react-form-renderer)

---
updated-dependencies:
- dependency-name: "@data-driven-forms/react-form-renderer"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-28 09:08:43 +02:00
dependabot[bot]
d9851a9a6f build(deps): bump react-redux from 8.0.5 to 8.1.2
Bumps [react-redux](https://github.com/reduxjs/react-redux) from 8.0.5 to 8.1.2.
- [Release notes](https://github.com/reduxjs/react-redux/releases)
- [Changelog](https://github.com/reduxjs/react-redux/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reduxjs/react-redux/compare/v8.0.5...v8.1.2)

---
updated-dependencies:
- dependency-name: react-redux
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-27 15:05:07 +02:00
Adi Abramovich
a890dc5666 wizard: add GCP image sharing options
Adding GCP image sharing option according to the discussion on slack(https://redhat-internal.slack.com/archives/C03AZ0264LW/p1692789579814619) and mocks(https://issues.redhat.com/browse/HMS-2352).

In summary, within our GCP sources, we store the project ID. Images cannot be shared directly with a project ID, but they can be shared with a service account or a Google account. Consequently, to launch instances in GCP, users are not required to provide their Google account; instead, the images should be shared with the provisioning service account. This ensures that the provisioning team has access to the necessary images, as sharing them with individual users would not allow that.

After a thorough discussion, we have collectively decided to introduce an option. This option allows users to exclusively utilize the Launch service without the need to share the image with a Google account.
2023-09-27 13:53:36 +02:00
Djebran Lezzoum
50b76751e7 edge: Fixes federated edge image details view.
The federated image details been broken by a prior PR.
FIXES: https://issues.redhat.com/browse/HMS-2620
2023-09-22 01:06:06 +02:00
dependabot[bot]
3e84abba3f build(deps-dev): bump @redhat-cloud-services/eslint-config-redhat-cloud-services
Bumps @redhat-cloud-services/eslint-config-redhat-cloud-services from 1.3.0 to 2.0.3.

---
updated-dependencies:
- dependency-name: "@redhat-cloud-services/eslint-config-redhat-cloud-services"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 10:53:23 +02:00
mgold1234
1bb7519cc4 api: add new edge endpoints
This commit adds 2 more RTQ Query in preparation of porting edge source code to image-builder-frontend
2023-09-19 10:27:23 +02:00
Justin Sherrill
5d6b6dfbfe Filter content-sources repos by origin and content_type 2023-09-19 09:22:37 +02:00
lucasgarfield
99ae627007 LaunchWizard: Correct architecture prop
The `<LaunchWizard>` architecture prop was specified incorrectly,
which caused the Instance dropdown in the Launch wizard to fail to load
instance types.
2023-09-18 16:08:57 +02:00
lucasgarfield
adaec7e34d LaunchWizard: Restore Launch wizard functionality
This commit is a hotfix that restores functionality to the Launch
wizard.

The `appendTo` variable can't be recomputed on every render. Wrap it in
a useState() hook to work properly.

Additionally, the `hasAccess`  property was missing from the
<ProvisioningWizard> component.

To ensure full backwards compatibility, the component has also been
wrapped in a <Suspense> as it was previously.
2023-09-18 15:38:47 +02:00
Thomas Lavocat
543d4e95d3 edge: setup an unleash toggle for the image table
The edge images table is going to be integrated in the frontend code
base in the coming weeks. To help smooth that development process there
is need for a feature flag that would keep the current behavior running
on stage and prod while the new image table is being developed.

For now dummy code is returned for when the flag is on, and legacy
behavior keeps on going when the flag is off.

The stage flag can be seen there:
- https://insights-stage.unleash.devshift.net/projects/default/features/image-builder.edge.local-image-table

The prod flag can be seen there:
- https://insights.unleash.devshift.net/projects/default/features/image-builder.edge.local-image-table

The commit brings in some documentation in the Readme. Any member of
the team should be able to follow these steps to add in new feature
flags and use them in the code base.

The commit also brings in two new testing files for the future
components to come. For now these tests only check that the mocking
value for the unleash flag is properly set.
2023-09-18 13:35:37 +02:00
lucasgarfield
7b9e726151 ImagesTable: Convert ImagesTable to Typescript & RTK Query
This commit converts the Images Table to Typescript and converts all API
calls to image-builder to use RTK Query hooks.

This should increase the performance of the app significantly.
Previously our calls to the image-builder API were made in series. They
are now made in parallel. We may want to investigate the possibility of
hitting rate limiting now that we will be issuing requests in much more
rapid succession.

In the tests, moving to RTK Query hooks has allowed us to remove
virtually all Jest mocking. However, this means that some of our
previous tests which tested against implementation details were broken.
Most notably, we no longer check the Redux store to verify that clones
have been added correctly and we no longer check that compose requests
were issued successfully. Test coverage will be restored in a follow-up
PR where the dev-dependency @msw/data is added. Adding a persistent data
layer to the tests using @msw/data will allow us to verify that our POST
requests (creating composes and cloning them) are working by testing
that the Images Table has been updated.
2023-09-18 10:35:04 +02:00
lucasgarfield
155a0cf57c deps-dev: bump @types/react and @types/react-dom
This commit bumps @types/react and @types/react-dom. Notably, this
prevents tsserver from issuing an error when React components return
undefined.
2023-09-18 10:35:04 +02:00
Jakub Rusz
4fe1242c49 Adding some ouiaId for File system customization 2023-09-13 15:56:10 +02:00
Ondrej Ezr
1e37a6ece9 Migrate to Provisioning API nested root 2023-09-11 15:19:31 +02:00
Thomas Lavocat
f147d5f4fe api: update from latest imageBuilder@main
Adds the composeId to the CloneResponseItem element.
Updates the mocks accordingly
2023-09-11 13:20:15 +02:00
mgold1234
e998dd802b API: generate more RTK query for edge
This commit adds more RTQ query in preparation of porting edge source code to image-builder-frontend
2023-09-11 11:09:51 +02:00
Thomas Lavocat
9fe77c5e67 readme: add documentation on API and enpoints 2023-09-11 11:01:33 +02:00
Thomas Lavocat
a999083404 ci: checks that the API is not manually changed
Travis will check that the API suffers from no changes while running
`npm run api` on the PR. If there are changes, an error message will
send the contributor to check the README page about open api generated
code.
2023-09-11 11:01:33 +02:00
Ondrej Ezr
b64f36e68f Extract quickstarts banner into its own component 2023-09-11 10:40:13 +02:00
regexowl
9f5a0af826 Wizard: Update the Repositories step
This updates the Repositories and Review step as per [mocks](https://www.sketch.com/s/d7aa6d29-fca0-4283-a846-09cc5fd10612/a/MyEbDz7).

Repositories with the unavailable or invalid status have a popover that allows for further inspection. The time of the last introspection and the counter of failed attempts was added to the popover, together with the "Go to Repositories" button.

On Recreate the payload repositories are checked against "freshly" fetched list of repositories. In case any of the previously checked repositories is no longer available in content sources an Alert is rendered on both Repositories and Review steps. The unavailable repository is checked, but the checkbox is disabled and the information is dashed out. Since the information about the repository is stored in the Repository type, the only information available to be rendered is the baseurl.

Create image button is also disabled when recreating an image with unavailable repositories.
2023-09-11 10:30:04 +02:00
Amir Fefer
0822a69619 feat(HMS-1454): add RBAC permissions to launch wizard 2023-09-07 14:18:44 +02:00
Tomáš Hozza
226a74ff99 Actions: add workflow for marking and closing stale issues and PRs
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-07 12:10:15 +02:00
Thomas Lavocat
01e9a1d152 api: ignore the generated code from eslintignore
Restore the edgeApi.ts file to the programmatically generated values by
rtkq and add the file to the list of ignored files for eslint.
2023-09-06 10:30:11 +02:00
dependabot[bot]
a149304801 build(deps-dev): bump stylelint from 15.10.2 to 15.10.3
Bumps [stylelint](https://github.com/stylelint/stylelint) from 15.10.2 to 15.10.3.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/15.10.2...15.10.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 08:42:36 +02:00
mgold1234
e266073718 Api: generate RTK Query for Edge
This commit adds the Edge API to RTK Query in preparation of porting edge source code to image-builder-frontend
2023-09-04 15:14:48 +02:00
lucasgarfield
85ab893c2b API: Add mutations for creating composes and clones
This commit adds mutations for the /compose and
/composes/:composeId/clone POST end points to the Image Builder API
slice.
2023-09-04 10:50:00 +02:00
dependabot[bot]
a28a1ab9cc build(deps): bump react-router-dom from 6.14.2 to 6.15.0
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.14.2 to 6.15.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.15.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 09:41:57 +02:00
dependabot[bot]
c84b493eba build(deps-dev): bump eslint-plugin-jest-dom from 5.0.1 to 5.1.0
Bumps [eslint-plugin-jest-dom](https://github.com/testing-library/eslint-plugin-jest-dom) from 5.0.1 to 5.1.0.
- [Release notes](https://github.com/testing-library/eslint-plugin-jest-dom/releases)
- [Commits](https://github.com/testing-library/eslint-plugin-jest-dom/compare/v5.0.1...v5.1.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest-dom
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 08:19:47 +02:00
dependabot[bot]
ac8c9ac3c3 build(deps-dev): bump @babel/plugin-transform-runtime
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.22.9 to 7.22.10.
- [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.22.10/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-31 12:35:38 +02:00
regexowl
ff0eb304bf test: Safeguard first setUp() in .test and .azure against early exit
The "Step Image output - clicking Next loads Upload to AWS" and "Step Upload to Azure - clicking Next loads Registration" were sometimes returning the "Warning: An update to <element> inside a test was not wrapped in act(...)" error.

This seems to have been caused by an early exit in the `setUp()` function in the first `describe` block.
Safeguards were put in place to fix this behaviour.

As this error didn't occur every time, testing the updates was not easy. This current fix passed the threshold of ten successful runs of `npm run test`.
2023-08-30 16:01:02 +02:00
regexowl
8a31592ef8 bootstrap: Fix "ReactDOM.render is deprecated since React 18.0.0" lint error
After bumping to React 18 linter was outputting following error: "ReactDOM.render is deprecated since React 18.0.0, use createRoot instead, see https://reactjs.org/link/switch-to-createroot"
This fixes the problem.
2023-08-30 16:01:02 +02:00
regexowl
38e2852734 test: Fix problem with mocked server.use calls
Test `component renders error state correctly` was outputting errors for both AWS and Azure tests.
This was caused by calling `server.use()` after the wizard was already rendered.

Fixed by moving the one time server mock response to the very beginning of the unit test. Also added `server.resetHandlers()` to be run after each of the unit tests.

Thanks to this fix, azure tests could be merged again. Which means no more splitting into `CreateImageWizard.azure.test.js` and `CreateImageWizard.azure.2.test.js`
2023-08-30 16:01:02 +02:00
regexowl
e71d98da08 test: Update CreateImageWizard tests
This updates following test suites after bumping react and testing-library:
- CreateImageWizard.azure.test.js
- CreateImageWizard.azure.2.test.js
- CreateImageWizard.content.test.js
- CreateImageWizard.test.js
2023-08-30 16:01:02 +02:00