Skip to content

Commit

Permalink
Merge pull request #1 from instructlab/extract-ui
Browse files Browse the repository at this point in the history
Extract UI from Bot repo for initial skeleton in the new UI repo
  • Loading branch information
vishnoianil authored Jun 13, 2024
2 parents d6aeb8a + 9f40590 commit a3ddb46
Show file tree
Hide file tree
Showing 65 changed files with 11,189 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.snap]
max_line_length = off
trim_trailing_whitespace = false

[*.md]
max_line_length = off
trim_trailing_whitespace = false
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
IL_UI_ADMIN_USERNAME=admin
IL_UI_ADMIN_PASSWORD=password
OAUTH_GITHUB_ID=<OAUTH_APP_ID>
OAUTH_GITHUB_SECRET=<OAUTH_APP_SECRET>
NEXTAUTH_SECRET=your_super_secret_random_string
NEXTAUTH_URL=http://localhost:3000
IL_GRANITE_API=<GRANITE_HOST>
IL_GRANITE_MODEL_NAME=<GRANITE_MODEL_NAME>
IL_MERLINITE_API=<MERLINITE_HOST>
IL_MERLINITE_MODEL_NAME=<MERLINITE_MODEL_NAME>
GITHUB_TOKEN=<TOKEN FOR OAUTH INSTRUCTLAB MEMBER LOOKUP>
TAXONOMY_REPO_OWNER=<GITHUB_ACCOUNT>
TAXONOMY_REPO=<REPO_NAME>
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": [
"next/core-web-vitals",
"@redhat-cloud-services/eslint-config-redhat-cloud-services",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"next",
"plugin:react-hooks/recommended",
"plugin:@next/next/recommended"
],
"settings": {
"react": {
"version": "detect"
}
}
}
40 changes: 40 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
pull_request_rules:
- name: dependabot-auto-merge
description: Automatically merge dependabot PRs that pass CI
conditions:
- author=dependabot[bot]
- check-success=golangci-lint-worker
- check-success=golangci-lint-bot
- check-success=ansible
- check-success=Shellcheck
- check-success=markdown-lint
- check-success=DCO
- label!=hold
actions:
merge:
method: merge

- name: auto-merge
description: automatic merge for main with > 1 approved reviews, all requested reviews have given feedback, not held, and CI is successful
conditions:
- "#approved-reviews-by>=1"
- "#review-requested=0"
- "#changes-requested-reviews-by=0"
- base=main
- label!=hold
- check-success=golangci-lint-worker
- check-success=golangci-lint-bot
- check-success=ansible
- check-success=Shellcheck
- check-success=markdown-lint
- check-success=DCO
# If files are changed in .github/, the actionlint check must pass
- or:
- and:
# regex should match the one in .github/workflows/actionlint.yml
- files~=.github/.*$
- check-success=actionlint
- -files~=.github/.*$
actions:
merge:
method: merge
28 changes: 28 additions & 0 deletions .github/workflows/lint-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: linters

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: markdownlint-cli2-action
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: "**/*.md"
38 changes: 38 additions & 0 deletions .github/workflows/lint-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: UI lint

on:
push:
branches: ["main"]
paths:
- '.github/workflows/lint-ui.yml'
- '**/*'
- '!**/*.md'
pull_request:
branches: ["main"]
paths:
- '.github/workflows/lint-ui.yml'
- '**/*'
- '!**/*.md'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
npm-lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Run UI linting
run: npm run lint
- name: Run UI type check
run: npm run type-check
- name: Run UI build
run: npm run build
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
node_modules
npm-debug.log
*.pem
!mock-cert.pem
.env
*.env
coverage
lib
taxonomy
config.yaml
generated
.DS_Store
**/node_modules
dist
yarn-error.log
yarn.lock
stats.json
.next/
auth.log
tsconfig.tsbuildinfo
.idea
13 changes: 13 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
config:
line-length: false
no-emphasis-as-header: false
first-line-heading: false
code-block-style: false
no-duplicate-header: false
single-trailing-newline: false
globs:
- "**/*.md"
ignores:
- "pkg"
- "**/node_modules/*"
- "**/node_modules/**"
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package.json
.next
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 150,
"arrowParens": "always",
"semi": true,
"tabWidth": 2,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSpacing": true,
"trailingComma": "none"
}
8 changes: 8 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: default
rules:
line-length: disable
document-start: disable

ignore: |
.github/workflows/*.yml
73 changes: 73 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at . All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This [Code of Conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html)
is adapted from the [Contributor Covenant][homepage], version 1.4.

[homepage]: https://www.contributor-covenant.org
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Contributing

[fork]: /fork
[pr]: /compare
[code-of-conduct]: CODE_OF_CONDUCT.md

Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.

Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms.

## Issues and PRs

If you have suggestions for how this project could be improved, or want to report a bug, open an issue! We'd love all and any contributions. If you have questions, too, we'd love to hear them.

We'd also love PRs. If you're thinking of a large PR, we advise opening up an issue first to talk about it, though! Look at the links below if you're not sure how to open a PR.

## Submitting a pull request

1. [Fork][fork] and clone the repository.
1. Configure and install the dependencies: `npm install`.
1. Make sure the tests pass on your machine: `npm run pretty`, `npm run lint`, `npm run type-check`, note: these tests also apply the linter, so there's no need to lint separately.
1. Create a new branch: `git checkout -b my-branch-name`.
1. Make your change, add tests, and make sure the tests still pass.
1. Push to your fork and [submit a pull request][pr].
1. Pat your self on the back and wait for your pull request to be reviewed and merged.

Here are a few things you can do that will increase the likelihood of your pull request being accepted:

- Write and update tests.
- Keep your changes as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).

Work in Progress pull requests are also welcome to get feedback early on, or if there is something blocked you.

## Resources

- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
- [GitHub Help](https://help.github.com)
10 changes: 10 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:22-alpine

WORKDIR /app

COPY package*.json ./
RUN npm install
COPY ./ .

RUN npm run build
CMD ["npm", "run", "start"]
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
# ui
# InstructLab UI

A GitHub UI to increase contributor test and review velocity for
[instructlab/taxonomy](https://github.com/instructlab/taxonomy).

## Overview

Personas:

- Taxonomy **Contributor**
- Taxonomy **Triager**

The technical overview and developer docs for getting started can be found [here](docs/development.md).

## Contributing

If you have suggestions for how instructlab/ui could be improved, or want to
report a bug, open an issue! We'd love all and any contributions.

For more, check out the [InstructLab Bot Contribution Guide](CONTRIBUTING.md)
and [InstructLab
Community](https://github.com/instructlab/community/blob/main/CONTRIBUTING.md).

## License

[Apache 2.0](LICENSE)
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You can find information on how to report a potential security vulnerability, as well as where to subscribe to receive security alerts, on the project's [Security Page](https://github.com/instructlab/.github/blob/main/SECURITY.md).
Loading

0 comments on commit a3ddb46

Please sign in to comment.