Skip to content

Commit

Permalink
Merge pull request #304 from project-koku/release_prod-stable.76989
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 dda2ad4 + fb33932 commit ca90b0b
Show file tree
Hide file tree
Showing 9 changed files with 413 additions and 234 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.
46 changes: 0 additions & 46 deletions .github/workflows/pull_request.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
esac
TAG="r.$DATE.$MINOR_VERSION"
git config --local user.email "[email protected]"
git config --local user.name "Cost Management Release Action"
git config --local user.name "Cost Management MFE Release Action"
git log $(git tag --list | tail -1)..prod-stable | git tag -a $TAG -F -
git push origin $TAG
shell: bash
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Koku microfrontend (MFE) with Module Federation

[![AGPLv3][license-badge]][license]
[![Build Status][build-badge]][build]
[![Apache 2.0][license-badge]](https://github.com/project-koku/koku-ui-mfe/blob/main/LICENSE)
[![CI Status][build-badge]](https://github.com/project-koku/koku-ui-mfe/actions/workflows/ci.yml?query=branch%3Amain)
[![codecov][codecov-badge]](https://codecov.io/gh/project-koku/koku-ui-mfe)

React.js app for Cost Management.

User interface is based on Patternfly [![Patternfly][pf-logo]][patternfly]
User interface is based on [Patternfly].

To submit an issue, please visit https://issues.redhat.com/projects/COST/
Submit issues in [Jira].

## Requirements

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

## Setup /etc/hosts entries (do this once)
## Setup `hosts` entries (do this once)

Edit the /etc/hosts file and add the following entries
Edit the `/etc/hosts` file and add the following entries
```
127.0.0.1 prod.foo.redhat.com
127.0.0.1 stage.foo.redhat.com
Expand All @@ -27,8 +29,9 @@ sudo bash scripts/patch-etc-hosts.sh
```

## Getting Started

1. Install requirements listed above.
2. Setup /etc/hosts entries listed above.
2. Setup `/etc/hosts` entries listed above.
3. Clone the repository, and open a terminal in the base of this project.
4. Run the command `npm install` to install all the dependencies.

Expand All @@ -43,6 +46,7 @@ npm test
```

## Running Koku MFE 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 @@ -63,7 +67,7 @@ https://stage.foo.redhat.com:1337/beta/staging/cost-management

### Running Koku MFE 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 @@ -77,7 +81,7 @@ npm start:csb

### Running Koku MFE with local Koku UI

See https://github.com/project-koku/koku-ui
Refer to the [koku-ui README][koku-ui-readme] for more details

1. Start development server in Koku MFE repo
```
Expand All @@ -91,8 +95,7 @@ npm start:mfe

### Running Koku MFE with local Koku UI 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
Refer to the [serving files locally][serving-files-locally] section of cloud services config and the [koku-ui README][koku-ui-readme] for more details

1. Serve files locally from Cloud Services Backend repo
```
Expand All @@ -113,12 +116,14 @@ npm start:csb:mfe

This [RELEASE][release-doc] doc describes how to release Koku MFE to each staging environment.

[koku-readme]: https://github.com/project-koku/koku#readme
[license-badge]: https://img.shields.io/github/license/project-koku/koku-ui-mfe.svg?longCache=true&style=for-the-badge
[license]: https://github.com/project-koku/koku-ui-mfe/blob/main/LICENSE
[build-badge]: https://github.com/project-koku/koku-ui-mfe/actions/workflows/ci.yml/badge.svg?branch=main
[codecov-badge]: https://codecov.io/gh/project-koku/koku-ui-mfe/graph/badge.svg?token=1hjFIy1cRe
[Jira]: https://issues.redhat.com/projects/COST/
[koku-ui-readme]: https://github.com/project-koku/koku-ui#readme
[license-badge]: https://img.shields.io/github/license/project-koku/koku-ui-mfe.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
[pf-logo]: https://www.patternfly.org/v4/images/logo.4189e7eb1a0741ea2b3b51b80d33c4cb.svg
[patternfly]: https://www.patternfly.org/
[Patternfly]: https://www.patternfly.org/
[release-doc]: https://github.com/project-koku/koku-ui-mfe/blob/main/RELEASE.md
[npm]: https://https://www.npmjs.com/
[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 @@ -29,7 +29,7 @@ module.exports = {
$schema: 'http://json.schemastore.org/swcrc',
jsc: {
experimental: {
plugins: [['jest_workaround', {}]],
plugins: [['swc_mut_cjs_exports', {}]],
},
parser: {
jsx: true,
Expand Down
Loading

0 comments on commit ca90b0b

Please sign in to comment.