Skip to content

Commit

Permalink
Merge pull request #1 from opendatahub-io-contrib/devops-pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
caldeirav authored Apr 30, 2024
2 parents f3d283e + d928919 commit 24456fd
Show file tree
Hide file tree
Showing 19 changed files with 664 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
about: Create a report to help us improve
assignees: ''
labels: ''
name: Bug report
title: ''
---

## Describe the bug

A clear and concise description of what the bug is.

## To Reproduce

Steps to reproduce the behavior:

1. Go to '...'
1. Click on '....'
1. Scroll down to '....'
1. See error

## Expected behavior

A clear and concise description of what you expected to happen.

## Screenshots / Logs.

If applicable, add screenshots to help explain your problem.

## Environment

- OS: \[e.g. iOS\]
- Python version:
- Installed packages:
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/proposed_change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
about: Propose a change to the genai-llm-rag-app project
assignees: ''
labels: ''
name: Proposed change
title: ''
---

## Issue description / feature objectives

## Caveats / Assumptions

## Completion Criteria
30 changes: 30 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Hot fix (emergency fix and release)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Documentation (change which affects the documentation site)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Release (`develop` -> `main`)

## Quality assurance (all should be covered).

- [ ] My code follows the code style of this project.
- [ ] Documentation for my change is up to date?
- [ ] My PR meets testing requirements.
- [ ] All new and existing tests passed.
- [ ] All commits are signed-off.

## Summary

## Key links:

- [Sonar coverage](https://sonarcloud.io/dashboard?id=compliance-trestle)

# Before you merge

- Ensure it is a 'squash commit' if not a release.
- Ensure CI is currently passing
- Check sonar. If you are working for a fork a maintainer will reach out, if required.
30 changes: 30 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/merge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Merge to trunk branch
about: For all contributions of new features and fixes that are not time critical.
title: 'chore: Replace me using the semantic release commit format.'
assignees: butler54
---

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Documentation (change which affects the documentation site)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Quality assurance (all should be covered).

- [ ] My code follows the code style of this project.
- [ ] Documentation for my change is up to date?
- [ ] My PR meets testing requirements.
- [ ] All new and existing tests passed.
- [ ] All commits are signed-off.

## Summary

# Before you merge

- Ensure it is a 'squash commit'
- Ensure CI is currently passing
2 changes: 2 additions & 0 deletions .github/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require:
members: false
25 changes: 25 additions & 0 deletions .github/workflows/conventional-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Lint PR title"

on:
pull_request_target:
types:
- opened
- edited
- synchronize
branches:
- 'main'
jobs:
lint:
if: ${{ github.head_ref != 'main' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: npm install @commitlint/cli @commitlint/config-conventional

- name: Validate PR title
run: |
PR_TITLE=$(jq -r '.pull_request.title' "$GITHUB_EVENT_PATH")
echo "$PR_TITLE" | npx commitlint --config commitlint.config.js
48 changes: 48 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: PR pipeline
on:
pull_request:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Don't mess with line endings
run: |
git config --global core.autocrlf false
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ubuntu-latest-3.12-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
ubuntu-latest-3.9-pip-
- name: Install build tools
run: |
make develop
- name: Setup pre-commit
run: |
make pre-commit
- name: Run md document formatting (mdformat)
run: |
make mdformat
- name: Run code formatting (yapf)
run: |
make code-format
- name: Run code linting (flake8)
run: |
make code-lint
- name: Run code typing check (mypy)
continue-on-error: true
run: |
make code-typing
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Messy merges
*.orig
# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

.settings
.project
.pydevproject

# Dependency directories (remove the comment below to include it)
# vendor/
venv
*.egg-info
.vscode/settings.json
.vscode
pytest.ini

# jupyter notebooks for local tests and prototypes
*.ipynb

_*/

#OS X
.DS_Store

# pyenv file to fix local python version
.python-version

build
dist
tmp

.coverage*
coverage.xml
cov_html

site
/.pytest_cache/

tmp_bin_test
.mypy_cache

/venv.trestle/

33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 # Use the ref you want to point at
hooks:
- id: check-merge-conflict
- id: check-yaml
exclude: "tests/data/yaml/bad_simple.yaml"
- id: no-commit-to-branch
args: [--branch, develop, --branch, main]
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.32.0
hooks:
- id: yapf
args: [--in-place, --parallel, --recursive, --style, .yapf-config]
stages: [commit]
additional_dependencies: [toml]
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [--extend-ignore, "P1,C812,C813,C814,C815,C816,W503,W605,B017,B028"]
additional_dependencies: [flake8-2020, flake8-broken-line, flake8-bugbear, flake8-builtins, flake8-commas, flake8-comprehensions, flake8-docstrings, flake8-eradicate, flake8-import-order, flake8-mutable, flake8-pep3101, flake8-print, flake8-quotes, flake8-string-format, flake8-use-fstring, pep8-naming]
stages: [commit]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
exclude: "CHANGELOG.md"
additional_dependencies:
- mdformat-tables
- mdformat-config
- mdformat-frontmatter
- mdformat-gfm
9 changes: 9 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[MASTER]
extension-pkg-whitelist=pydantic


[MESSAGES CONTROL]
disable=W1203, W1201

[FORMAT]
max-line-length=120
14 changes: 14 additions & 0 deletions .yapf-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[style]
based_on_style = facebook
align_closing_bracket_with_visual_indent = true
allow_split_before_dict_value = false
blank_line_before_nested_class_or_def = true
column_limit = 120
indent_dictionary_value = false
split_all_top_level_comma_separated_values = true
split_arguments_when_comma_terminated = true
split_before_arithmetic_operator = true
split_before_expression_after_opening_paren = true
split_before_first_argument = true
split_before_logical_operator = true
split_complex_comprehension = true
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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, sex characteristics, 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 [email protected]. 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 is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

[homepage]: https://www.contributor-covenant.org
Loading

0 comments on commit 24456fd

Please sign in to comment.