-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3815 from project-koku/release_prod-stable.76974
Deployment commit for prod-stable
- Loading branch information
Showing
88 changed files
with
1,610 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [ main, prod-beta, prod-stable, stage-beta, stage-stable ] | ||
push: | ||
branches: [ main, prod-beta, prod-stable, stage-beta, stage-stable ] | ||
|
||
env: | ||
BRANCH: ${{ github.base_ref }} | ||
NODEJS_VERSION: '18' | ||
|
||
jobs: | ||
build: | ||
# This job is run for PRs only, as a sanity check, to confirm ci.ext.devshift.net is working properly | ||
if: ${{ github.event_name == 'pull_request' }} | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODEJS_VERSION }} | ||
|
||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
units: | ||
name: Units | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODEJS_VERSION }} | ||
|
||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Test | ||
id: test_run | ||
run: npm test -- --collect-coverage --max-workers=4 | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: ${{ steps.test_run.outcome == 'success' }} | ||
name: Save coverage report | ||
with: | ||
name: coverage_report | ||
path: coverage/ | ||
retention-days: 10 | ||
|
||
coverage: | ||
name: Coverage | ||
needs: [units] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download coverage report | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: coverage_report | ||
path: coverage | ||
|
||
- name: Upload coverage report | ||
if: ${{ success() }} | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
directory: coverage | ||
plugin: pycoverage # Only run one plugin so that all do not run. There is no way to disable plugins entirely. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Koku UI | ||
|
||
[![Apache 2.0][license-badge]](https://github.com/project-koku/koku-ui/blob/main/LICENSE) | ||
[![CI Status][build-badge]](https://github.com/project-koku/koku-ui/actions/workflows/tag_release.yml) | ||
[![CI Status][build-badge]](https://github.com/project-koku/koku-ui/actions/workflows/ci.yml?query=branch%3Amain) | ||
[![codecov][codecov-badge]](https://codecov.io/gh/project-koku/koku-ui) | ||
|
||
React.js app for Cost Management. | ||
|
@@ -11,6 +11,7 @@ User interface is based on [Patternfly]. | |
Submit issues in [Jira]. | ||
|
||
## Requirements | ||
|
||
* [NodeJS v18.15+][nodejs] | ||
* [npm v9.5+][npm] | ||
|
||
|
@@ -28,6 +29,7 @@ sudo bash scripts/patch-etc-hosts.sh | |
``` | ||
|
||
## Getting Started | ||
|
||
1. Install requirements listed above. | ||
2. Setup `/etc/hosts` entries listed above. | ||
3. Clone the repository, and open a terminal in the base of this project. | ||
|
@@ -44,6 +46,7 @@ npm test | |
``` | ||
|
||
## Running Koku UI against a hosted Koku API, using webpack proxy | ||
|
||
Note that this approach currently supports the Insights stage-beta, stage-stable, prod-beta, and prod-stable environments. | ||
|
||
1. Start development server | ||
|
@@ -64,7 +67,7 @@ https://stage.foo.redhat.com:1337/beta/openshift/cost-management | |
|
||
### Running Koku UI with local Cloud Services Backend | ||
|
||
See https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md#serving-files-locally | ||
Refer to the [serving files locally][serving-files-locally] section of cloud services config for more details | ||
|
||
1. Serve files locally from Cloud Services Backend repo | ||
``` | ||
|
@@ -78,7 +81,7 @@ npm start:csb | |
|
||
### Running Koku UI with local Koku microfrontend (MFE) | ||
|
||
See https://github.com/project-koku/koku-ui-mfe | ||
Refer to the [koku-ui-mfe README][koku-ui-mfe-readme] for more details | ||
|
||
1. Start development server in Koku MFE repo | ||
``` | ||
|
@@ -92,8 +95,7 @@ npm start:mfe | |
|
||
### Running Koku UI with local Koku microfrontend (MFE) and Cloud Services Backend | ||
|
||
See https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md#serving-files-locally | ||
and https://github.com/project-koku/koku-ui-mfe | ||
Refer to the [serving files locally][serving-files-locally] section of cloud services config and the [koku-ui-mfe README][koku-ui-mfe-readme] for more details | ||
|
||
1. Serve files locally from Cloud Services Backend repo | ||
``` | ||
|
@@ -126,31 +128,32 @@ Follow the prompts that follow. | |
|
||
2. Open the following URL | ||
``` | ||
http://localhost:8002/beta/openshift/cost-management | ||
http://localhost:8002/beta/openshift/cost-management | ||
``` | ||
|
||
#### Koku API | ||
Refer to the project [README][koku-readme] for prerequisites | ||
|
||
1. Setup & run Koku API (see project [README][koku-readme] for more details) | ||
Refer to the [koku README][koku-readme] for more details | ||
|
||
1. Setup & run Koku API | ||
``` | ||
> git clone [email protected]:project-koku/koku.git | ||
> cd [KOKU_GIT_REPO] | ||
> pipenv install --dev | ||
> pipenv shell "pre-commit install" | ||
> make docker-up-min or make docker-up-min-trino | ||
> make create-test-customer | ||
> make load-test-customer-data (use with docker-up-min-trino) | ||
git clone [email protected]:project-koku/koku.git | ||
cd [KOKU_GIT_REPO] | ||
pipenv install --dev | ||
pipenv shell "pre-commit install" | ||
make docker-up-min or make docker-up-min-trino | ||
make create-test-customer | ||
make load-test-customer-data (use with docker-up-min-trino) | ||
``` | ||
|
||
2. Check to see if containers are running (optional) | ||
``` | ||
> docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Ports}}\t{{.Status}}" | ||
docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Ports}}\t{{.Status}}" | ||
``` | ||
|
||
3. Watch the Koku API logs in another terminal (optional) | ||
``` | ||
> docker-compose logs -f koku-server koku-worker | ||
docker compose logs -f koku-server koku-worker | ||
``` | ||
|
||
4. Clean up (optional) | ||
|
@@ -164,25 +167,25 @@ exit | |
|
||
## Running local instances of Settings Frontend & Koku API | ||
|
||
Follow the [steps](#koku-api) to run a local Koku API instance | ||
Follow the koku API [steps](#koku-api) to run a local Koku API instance | ||
|
||
1. Clone the Settings Frontend repository and install dependencies | ||
``` | ||
> git clone https://github.com/RedHatInsights/settings-frontend.git | ||
> cd [SETTINGS_FRONTEND_GIT_REPO] | ||
> npm install | ||
git clone https://github.com/RedHatInsights/settings-frontend.git | ||
cd [SETTINGS_FRONTEND_GIT_REPO] | ||
npm install | ||
``` | ||
|
||
2. Set the following variables in your environment | ||
``` | ||
> export API_PORT=8000 | ||
> export LOCAL_API="/api/cost-management/v1/" | ||
> export KEYCLOAK_PORT=4020 | ||
export API_PORT=8000 | ||
export LOCAL_API="/api/cost-management/v1/" | ||
export KEYCLOAK_PORT=4020 | ||
``` | ||
|
||
3. Start development server | ||
``` | ||
> npm run start:standalone:beta | ||
npm run start:standalone:beta | ||
``` | ||
|
||
4. Open the following URL | ||
|
@@ -194,14 +197,15 @@ http://localhost:1337/beta/settings/applications/cost-management | |
|
||
This [RELEASE][release-doc] doc describes how to release Koku UI to each staging environment. | ||
|
||
[build-badge]: https://github.com/project-koku/koku-ui/actions/workflows/tag_release.yml/badge.svg | ||
[license-badge]: https://img.shields.io/github/license/project-koku/koku-ui.svg?longCache=true | ||
[build-badge]: https://github.com/project-koku/koku-ui/actions/workflows/ci.yml/badge.svg?branch=main | ||
[codecov-badge]: https://codecov.io/gh/project-koku/koku-ui/graph/badge.svg?token=1hjFIy1cRe | ||
|
||
[Jira]: https://issues.redhat.com/projects/COST/ | ||
[koku-readme]: https://github.com/project-koku/koku#readme | ||
[koku-ui-mfe-readme]: https://github.com/project-koku/koku-ui-mfe#readme | ||
[license-badge]: https://img.shields.io/github/license/project-koku/koku-ui.svg?longCache=true | ||
[nodejs]: https://nodejs.org/en/ | ||
[npm]: https://www.npmjs.com/ | ||
[patch-etc-hosts]: https://github.com/RedHatInsights/insights-proxy/blob/master/scripts/patch-etc-hosts.sh | ||
[Patternfly]: https://www.patternfly.org/ | ||
[release-doc]: https://github.com/project-koku/koku-ui/blob/main/RELEASE.md | ||
[npm]: https://www.npmjs.com/ | ||
[Jira]: https://issues.redhat.com/projects/COST/ | ||
[serving-files-locally]: https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md#serving-files-locally |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.