-
Notifications
You must be signed in to change notification settings - Fork 10
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 #1 from mattray/migration
UI Migration cleanups
- Loading branch information
Showing
13 changed files
with
8,338 additions
and
10 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,30 @@ | ||
--- | ||
name: OpenCost UI Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the OpenCost bug is. Please ensure this is an issue related to the OpenCost _UI_. General OpenCost issues may be opened in the [OpenCost repository](https://github.com/opencost/opencost). | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Which version of OpenCost are you using?** | ||
You can find the version from the container's startup logging or from the bottom of the page in the UI. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. Kubernetes versions and which public clouds you are working with are especially important. |
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,20 @@ | ||
--- | ||
name: OpenCost UI Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context, documentation links, or screenshots about the feature request here. |
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,20 @@ | ||
## What does this PR change? | ||
* | ||
|
||
## Does this PR relate to any other PRs? | ||
* | ||
|
||
## How will this PR impact users? | ||
* | ||
|
||
## Does this PR address any GitHub or Zendesk issues? | ||
* Closes ... | ||
|
||
## How was this PR tested? | ||
* | ||
|
||
## Does this PR require changes to documentation? | ||
* | ||
|
||
## Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not? | ||
* |
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,5 @@ | ||
## https://github.com/marketplace/actions/close-stale-issues#recommended-permissions | ||
# Give stalebot permission to update issues and pull requests | ||
permissions: | ||
issues: write | ||
pull-requests: write |
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,13 @@ | ||
version: 2 | ||
updates: | ||
# Dependencies listed in .github/workflows/*.yml | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
# Dependencies listed in ui/package.json | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,14 @@ | ||
name: auto-label-new-issues | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
automate-issues-labels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Label new issues with 'needs-triage' | ||
uses: andymckay/[email protected] | ||
with: | ||
add-labels: "needs-triage" |
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,119 @@ | ||
name: Build and Publish Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
workflow_dispatch: | ||
inputs: | ||
release_version: | ||
description: "Version of the release" | ||
required: true | ||
|
||
concurrency: | ||
group: build-opencost | ||
cancel-in-progress: true | ||
|
||
env: | ||
# Use docker.io for Docker Hub if empty | ||
REGISTRY: ghcr.io | ||
# github.repository as <account>/<repo> | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-publish-opencost: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Get Version From Tag | ||
id: tag | ||
if: ${{ github.event_name }} == 'push' | ||
run: | | ||
echo "TRIGGERED_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Determine Version Number | ||
id: version_number | ||
run: | | ||
if [ -z "${TRIGGERED_TAG}" ]; | ||
then | ||
version=${{ inputs.release_version }} | ||
else | ||
version=$TRIGGERED_TAG | ||
fi | ||
if [[ ${version:0:1} == "v" ]]; | ||
then | ||
echo "RELEASE_VERSION=${version:1}" >> $GITHUB_OUTPUT | ||
else | ||
echo "RELEASE_VERSION=$version" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Show Input Values | ||
run: | | ||
echo "release version: ${{ inputs.release_version }}" | ||
- name: Make Branch Name | ||
id: branch | ||
run: | | ||
VERSION_NUMBER=${{ steps.version_number.outputs.RELEASE_VERSION }} | ||
echo "BRANCH_NAME=v${VERSION_NUMBER%.*}" >> $GITHUB_ENV | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'opencost/opencost-ui' | ||
ref: '${{ steps.branch.outputs.BRANCH_NAME }}' | ||
path: ./opencost-ui | ||
|
||
- name: Set SHA | ||
id: sha | ||
run: | | ||
pushd ./opencost-ui | ||
echo "OC_SHORTHASH=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
popd | ||
# Login against a Docker registry except on PR | ||
# https://github.com/docker/login-action | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set OpenCost Image Tags | ||
id: tags | ||
run: | | ||
echo "IMAGE_TAG_UI=ghcr.io/opencost/opencost-ui:${{ steps.sha.outputs.OC_SHORTHASH }}" >> $GITHUB_OUTPUT | ||
echo "IMAGE_TAG_UI_LATEST=ghcr.io/opencost/opencost-ui:latest" >> $GITHUB_OUTPUT | ||
echo "IMAGE_TAG_UI_VERSION=ghcr.io/opencost/opencost-ui:${{ steps.version_number.outputs.RELEASE_VERSION }}" >> $GITHUB_OUTPUT | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
buildkitd-flags: --debug | ||
|
||
- name: Set up just | ||
uses: extractions/setup-just@v1 | ||
|
||
- name: Install crane | ||
uses: imjasonh/[email protected] | ||
|
||
## Install manifest-tool, which is required to combine multi-arch images | ||
## https://github.com/estesp/manifest-tool | ||
- name: Install manifest-tool | ||
run: | | ||
mkdir -p manifest-tool | ||
pushd manifest-tool | ||
wget -q https://github.com/estesp/manifest-tool/releases/download/v2.0.8/binaries-manifest-tool-2.0.8.tar.gz | ||
tar -xzf binaries-manifest-tool-2.0.8.tar.gz | ||
cp manifest-tool-linux-amd64 manifest-tool | ||
echo "$(pwd)" >> $GITHUB_PATH | ||
- name: Build and push (multiarch) OpenCost UI | ||
working-directory: ./opencost/ui | ||
run: | | ||
just build '${{ steps.tags.outputs.IMAGE_TAG_UI }}' '${{ steps.version_number.outputs.RELEASE_VERSION }}' | ||
crane copy '${{ steps.tags.outputs.IMAGE_TAG_UI }}' '${{ steps.tags.outputs.IMAGE_TAG_UI_LATEST }}' | ||
crane copy '${{ steps.tags.outputs.IMAGE_TAG_UI }}' '${{ steps.tags.outputs.IMAGE_TAG_UI_VERSION }}' |
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,47 @@ | ||
name: Build/Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
frontend: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: ./ | ||
|
||
- | ||
name: Install just | ||
uses: extractions/setup-just@v1 | ||
|
||
- | ||
name: Install node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.3.0' | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
shell: bash | ||
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | ||
|
||
- uses: actions/cache@v4 | ||
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('./ui/**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- | ||
name: Build | ||
working-directory: ./ | ||
run: | | ||
just build-local |
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,45 @@ | ||
name: needs-follow-up-label | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
issues: | ||
types: [opened, reopened, closed] | ||
|
||
jobs: | ||
set-follow-up-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check comment actor org membership | ||
id: response | ||
run: | | ||
echo "::set-output name=MEMBER_RESPONSE::$(curl -I -H 'Accept: application/vnd.github+json' -H 'Authorization: token ${{ github.token }}' 'https://api.github.com/orgs/kubecost/members/${{ github.actor }}')" | ||
- name: "Check for non-4XX response" | ||
id: membership | ||
run: | | ||
echo '${{ steps.response.outputs.MEMBER_RESPONSE }}' && echo "::set-output name=IS_MEMBER::$(grep 'HTTP/2 [2]' <<< '${{ steps.response.outputs.MEMBER_RESPONSE }}')" | ||
- name: Apply needs-follow-up label if this is a new or reopened issue by user not in the org | ||
if: ${{ steps.membership.outputs.IS_MEMBER == '' && github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened') }} | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
with: | ||
labels: needs-follow-up | ||
|
||
- name: Apply needs-follow-up label if comment by a user not in the org | ||
if: ${{ steps.membership.outputs.IS_MEMBER == '' && github.event_name == 'issue_comment' }} | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
with: | ||
labels: needs-follow-up | ||
|
||
- name: Remove needs-follow-up label if the issue has been closed | ||
if: ${{ github.event_name == 'issues' && github.event.action == 'closed' }} | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: needs-follow-up | ||
|
||
- name: Remove needs-follow-up label if comment by a user in the org | ||
if: ${{ steps.membership.outputs.IS_MEMBER != '' && github.event_name == 'issue_comment' }} | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: needs-follow-up |
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,19 @@ | ||
name: 'Close stale issues and PRs' | ||
on: | ||
schedule: | ||
- cron: '30 1 * * *' | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v9 | ||
with: | ||
stale-issue-message: 'This issue has been marked as stale because it has been open for 360 days with no activity. Please remove the stale label or comment or this issue will be closed in 5 days.' | ||
close-issue-message: 'This issue was closed because it has been inactive for 365 days with no activity.' | ||
stale-pr-message: 'This pull request has been marked as stale because it has been open for 90 days with no activity. Please remove the stale label or comment or this pull request will be closed in 5 days.' | ||
close-pr-message: 'This pull request was closed because it has been inactive for 95 days with no activity.' | ||
days-before-issue-stale: 360 | ||
days-before-issue-close: 5 | ||
days-before-pr-stale: 90 | ||
days-before-pr-close: 5 |
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,18 @@ | ||
# Jetbrains project files | ||
.idea | ||
*.iml | ||
|
||
.parcel-cache | ||
.cache | ||
dist | ||
.env | ||
node_modules/ | ||
|
||
# VS Code | ||
.vscode | ||
|
||
#Apple | ||
*.DS_Store | ||
|
||
# tilt | ||
tilt_config.json |
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.