Skip to content

Commit 4333557

Browse files
authored
Merge pull request #303 from project-koku/release_prod-beta.75244
Deployment commit for prod-beta
2 parents e37b58d + d14e0d2 commit 4333557

File tree

9 files changed

+413
-234
lines changed

9 files changed

+413
-234
lines changed

.github/workflows/ci.yml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ main, prod-beta, prod-stable, stage-beta, stage-stable ]
6+
push:
7+
branches: [ main, prod-beta, prod-stable, stage-beta, stage-stable ]
8+
9+
env:
10+
BRANCH: ${{ github.base_ref }}
11+
NODEJS_VERSION: '18'
12+
13+
jobs:
14+
build:
15+
# This job is run for PRs only, as a sanity check, to confirm ci.ext.devshift.net is working properly
16+
if: ${{ github.event_name == 'pull_request' }}
17+
name: Build
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ env.NODEJS_VERSION }}
28+
29+
- name: Cache node modules
30+
id: cache-npm
31+
uses: actions/cache@v4
32+
env:
33+
cache-name: cache-node-modules
34+
with:
35+
# npm cache files are stored in `~/.npm` on Linux/macOS
36+
path: ~/.npm
37+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
38+
restore-keys: |
39+
${{ runner.os }}-build-${{ env.cache-name }}-
40+
${{ runner.os }}-build-
41+
${{ runner.os }}-
42+
43+
- name: Install dependencies
44+
run: npm install
45+
46+
- name: Build
47+
run: npm run build
48+
49+
- name: Lint
50+
run: npm run lint
51+
52+
units:
53+
name: Units
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v4
59+
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: ${{ env.NODEJS_VERSION }}
64+
65+
- name: Cache node modules
66+
id: cache-npm
67+
uses: actions/cache@v4
68+
env:
69+
cache-name: cache-node-modules
70+
with:
71+
# npm cache files are stored in `~/.npm` on Linux/macOS
72+
path: ~/.npm
73+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
74+
restore-keys: |
75+
${{ runner.os }}-build-${{ env.cache-name }}-
76+
${{ runner.os }}-build-
77+
${{ runner.os }}-
78+
79+
- name: Install dependencies
80+
run: npm install
81+
82+
- name: Test
83+
id: test_run
84+
run: npm test -- --collect-coverage --max-workers=4
85+
86+
- uses: actions/upload-artifact@v4
87+
if: ${{ steps.test_run.outcome == 'success' }}
88+
name: Save coverage report
89+
with:
90+
name: coverage_report
91+
path: coverage/
92+
retention-days: 10
93+
94+
coverage:
95+
name: Coverage
96+
needs: [units]
97+
runs-on: ubuntu-latest
98+
99+
steps:
100+
- name: Checkout code
101+
uses: actions/checkout@v4
102+
103+
- name: Download coverage report
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: coverage_report
107+
path: coverage
108+
109+
- name: Upload coverage report
110+
if: ${{ success() }}
111+
uses: codecov/codecov-action@v4.2.0
112+
env:
113+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
114+
with:
115+
directory: coverage
116+
plugin: pycoverage # Only run one plugin so that all do not run. There is no way to disable plugins entirely.

.github/workflows/pull_request.yml

-46
This file was deleted.

.github/workflows/tag_release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
esac
3131
TAG="r.$DATE.$MINOR_VERSION"
3232
git config --local user.email "cost-mgmt@redhat.com"
33-
git config --local user.name "Cost Management Release Action"
33+
git config --local user.name "Cost Management MFE Release Action"
3434
git log $(git tag --list | tail -1)..prod-stable | git tag -a $TAG -F -
3535
git push origin $TAG
3636
shell: bash

README.md

+22-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
# Koku microfrontend (MFE) with Module Federation
22

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

67
React.js app for Cost Management.
78

8-
User interface is based on Patternfly [![Patternfly][pf-logo]][patternfly]
9+
User interface is based on [Patternfly].
910

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

1213
## Requirements
14+
1315
* [NodeJS v18.15+][nodejs]
1416
* [npm v9.5+][npm]
1517

16-
## Setup /etc/hosts entries (do this once)
18+
## Setup `hosts` entries (do this once)
1719

18-
Edit the /etc/hosts file and add the following entries
20+
Edit the `/etc/hosts` file and add the following entries
1921
```
2022
127.0.0.1 prod.foo.redhat.com
2123
127.0.0.1 stage.foo.redhat.com
@@ -27,8 +29,9 @@ sudo bash scripts/patch-etc-hosts.sh
2729
```
2830

2931
## Getting Started
32+
3033
1. Install requirements listed above.
31-
2. Setup /etc/hosts entries listed above.
34+
2. Setup `/etc/hosts` entries listed above.
3235
3. Clone the repository, and open a terminal in the base of this project.
3336
4. Run the command `npm install` to install all the dependencies.
3437

@@ -43,6 +46,7 @@ npm test
4346
```
4447

4548
## Running Koku MFE against a hosted Koku API, using webpack proxy
49+
4650
Note that this approach currently supports the Insights stage-beta, stage-stable, prod-beta, and prod-stable environments.
4751

4852
1. Start development server
@@ -63,7 +67,7 @@ https://stage.foo.redhat.com:1337/beta/staging/cost-management
6367

6468
### Running Koku MFE with local Cloud Services Backend
6569

66-
See https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md#serving-files-locally
70+
Refer to the [serving files locally][serving-files-locally] section of cloud services config for more details
6771

6872
1. Serve files locally from Cloud Services Backend repo
6973
```
@@ -77,7 +81,7 @@ npm start:csb
7781

7882
### Running Koku MFE with local Koku UI
7983

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

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

9296
### Running Koku MFE with local Koku UI and Cloud Services Backend
9397

94-
See https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md#serving-files-locally
95-
and https://github.com/project-koku/koku-ui
98+
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
9699

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

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

116-
[koku-readme]: https://github.com/project-koku/koku#readme
117-
[license-badge]: https://img.shields.io/github/license/project-koku/koku-ui-mfe.svg?longCache=true&style=for-the-badge
118-
[license]: https://github.com/project-koku/koku-ui-mfe/blob/main/LICENSE
119+
[build-badge]: https://github.com/project-koku/koku-ui-mfe/actions/workflows/ci.yml/badge.svg?branch=main
120+
[codecov-badge]: https://codecov.io/gh/project-koku/koku-ui-mfe/graph/badge.svg?token=1hjFIy1cRe
121+
[Jira]: https://issues.redhat.com/projects/COST/
122+
[koku-ui-readme]: https://github.com/project-koku/koku-ui#readme
123+
[license-badge]: https://img.shields.io/github/license/project-koku/koku-ui-mfe.svg?longCache=true
119124
[nodejs]: https://nodejs.org/en/
125+
[npm]: https://www.npmjs.com/
120126
[patch-etc-hosts]: https://github.com/RedHatInsights/insights-proxy/blob/master/scripts/patch-etc-hosts.sh
121-
[pf-logo]: https://www.patternfly.org/v4/images/logo.4189e7eb1a0741ea2b3b51b80d33c4cb.svg
122-
[patternfly]: https://www.patternfly.org/
127+
[Patternfly]: https://www.patternfly.org/
123128
[release-doc]: https://github.com/project-koku/koku-ui-mfe/blob/main/RELEASE.md
124-
[npm]: https://https://www.npmjs.com/
129+
[serving-files-locally]: https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md#serving-files-locally

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
$schema: 'http://json.schemastore.org/swcrc',
3030
jsc: {
3131
experimental: {
32-
plugins: [['jest_workaround', {}]],
32+
plugins: [['swc_mut_cjs_exports', {}]],
3333
},
3434
parser: {
3535
jsx: true,

0 commit comments

Comments
 (0)