Skip to content

Latest commit

 

History

History
149 lines (126 loc) · 5.06 KB

CONTRIBUTING.md

File metadata and controls

149 lines (126 loc) · 5.06 KB

How to Contribute

Developer Certificate of Origin

By contributing to this project you agree to the Developer Certificate of Origin (DCO). This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution. See the DCO file for details.

About the repository's folder structure

This is a monorepo, as such, it's composed of many different projects.
The principal folders are: apps and libs.

Prerequisites

  1. A Linux distro, like Fedora.
  2. NodeJS > v14, or newer LTS version.
  3. Yarn
  4. This project uses rsync in order to synchronize .css files in one if it's build steps.
  5. A back-end API to connect to. Please see instructions in assisted-test-infra.

Setting up a local dev-environment (stand-alone)

  1. Create your own fork of this repo and git clone it.
    git clone https://github.com/<username>/assisted-installer-ui.git
  2. Create a .env.local file in apps/assisted-ui/ and add the Assisted Installer API URL
    AIUI_APP_API_URL=http://<host-ip>:6008
  3. Set up the package managers shims and install the project dependencies:
    yarn install
  4. Build the project
    yarn build:all
  5. Start the Assisted Installer UI stand-alone app
    yarn workspace @openshift-assisted/assisted-ui serve
  6. Browse to http://localhost:5173/ using a modern web browser.

Integrating with uhc-portal (OCM)

The Assisted Installer UI is consumed as a library at build-time by other applications.
The uhc-portal is one of them and is the application you see at https://console.redhat.com/openshift.

Use this setup if you want to test the libs/ui-lib integration with the uhc-portal. These steps apply for libs/locales as well.

  1. Install yalc (it simulates local package registry).
    # with yarn:
    yarn global add yalc
    # or with npm:
    npm i -g yalc
    # then verify the command works as expected
    yalc --version
  2. In one terminal run libs/ui-lib in watch mode.
    The script builds and publishes the @openshift-assisted/ui-lib package to the local registry everytime you make a change.
    yarn workspace @openshift-assisted/ui-lib watch
  3. Fork and clone the uhc-portal project
    git clone https://gitlab.cee.redhat.com/<username>/uhc-portal.git
  4. Inside the uhc-portal run the following commands
    yarn install
    yalc link @openshift-assisted/ui-lib
    yalc link @openshift-assisted/locales
    yalc link needs to be executed only after cloning or pulling new changes from the uhc-portal. Be aware that this command updates the project's yarn.lock file.
    DO NOT COMMIT THESE CHANGES INTO VERSION CONTROL.
  5. Now you can follow the uhc-portal's README file in order to set up their dev-environment.

Integrating with CIM

Central infrastructure management part of Assisted Installer UI is integrated into stolostron/console.

Use this setup if you want to test the libs/ui-lib integration with the stolostron/console. These steps apply for libs/locales as well.

  1. Install yalc (it simulates local package registry).

    # with yarn:
    yarn global add yalc
    # or with npm:
    npm i -g yalc
    # then verify the command works as expected
    yalc --version
  2. In one terminal run libs/ui-lib in watch mode.
    The script builds and publishes the @openshift-assisted/ui-lib package to the local registry everytime you make a change.

    yarn workspace @openshift-assisted/ui-lib watch
  3. In another terminal run libs/locales in watch mode.
    The script builds and publishes the @openshift-assisted/locales package to the local registry everytime you make a change.

    yarn workspace @openshift-assisted/locales watch
  4. Follow the stolostron/console development setup guide.

  5. To use locally published @openshift-assisted packages inside the stolostron/console run the following commands

    cd frontend
    yalc link @openshift-assisted/ui-lib
    yalc link @openshift-assisted/locales

    Note that these commands need to be re-executed every time the npm install is run in the frontend directory.

Updating the API types

The TypeScript types used by Assisted Installer UI are generated automatically from the assisted-service's swagger file.
These can be generated automatically by running:

yarn workspace @openshift-assisted/ui-lib update-api