Skip to content

Commit

Permalink
Merge pull request #3815 from project-koku/release_prod-stable.76974
Browse files Browse the repository at this point in the history
Deployment commit for prod-stable
  • Loading branch information
dlabrecq authored Apr 17, 2024
2 parents 88ba24e + 19a5e35 commit 9bfccd0
Show file tree
Hide file tree
Showing 88 changed files with 1,610 additions and 419 deletions.
116 changes: 116 additions & 0 deletions .github/workflows/ci.yml
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.
66 changes: 0 additions & 66 deletions .github/workflows/pull_request.yml

This file was deleted.

64 changes: 34 additions & 30 deletions README.md
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.
Expand All @@ -11,6 +11,7 @@ User interface is based on [Patternfly].
Submit issues in [Jira].

## Requirements

* [NodeJS v18.15+][nodejs]
* [npm v9.5+][npm]

Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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
```
Expand All @@ -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
```
Expand All @@ -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
```
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
$schema: 'http://json.schemastore.org/swcrc',
jsc: {
experimental: {
plugins: [['jest_workaround', {}]],
plugins: [['swc_mut_cjs_exports', {}]],
},
parser: {
jsx: true,
Expand Down
6 changes: 6 additions & 0 deletions locales/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,12 @@
"value": "Cost Management"
}
],
"costModel": [
{
"type": 0,
"value": "Cost Model:"
}
],
"costModels": [
{
"type": 0,
Expand Down
1 change: 1 addition & 0 deletions locales/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"costDistributionTitle": "Overhead cost breakdown",
"costDistributionType": "{value, select, distributed {Distribute through cost models} total {Don't distribute overhead costs} other {}}",
"costManagement": "Cost Management",
"costModel": "Cost Model:",
"costModels": "Cost Models",
"costModelsActions": "Cost model actions",
"costModelsAddTagValues": "Add more tag values",
Expand Down
Loading

0 comments on commit 9bfccd0

Please sign in to comment.