Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charm review PR #80

Open
wants to merge 1 commit into
base: charm-review-base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Bug Report
description: File a bug report
labels: ["Type: Bug", "Status: Triage"]
body:
- type: markdown
attributes:
value: >
Thanks for taking the time to fill out this bug report! Before submitting your issue, please make
sure you are using the latest version of the charm. If not, please switch to this image prior to
posting your report to make sure it's not already solved.
- type: textarea
id: bug-description
attributes:
label: Bug Description
description: >
If applicable, add screenshots to help explain the problem you are facing.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: To Reproduce
description: >
Please provide a step-by-step instruction of how to reproduce the behavior.
placeholder: |
1. `juju deploy ...`
2. `juju relate ...`
3. `juju status --relations`
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: >
We need to know a bit more about the context in which you run the charm.
- Are you running Juju locally, on lxd, in multipass or on some other platform?
- What track and channel you deployed the charm from (i.e. `latest/edge` or similar).
- Version of any applicable components, like the juju snap, the model controller, lxd, microk8s, and/or multipass.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: >
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
Fetch the logs using `juju debug-log --replay` and `kubectl logs ...`. Additional details available in the juju docs
at https://juju.is/docs/olm/juju-logs
render: shell
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional context

17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement_proposal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Enhancement Proposal
description: File an enhancement proposal
labels: ["Type: Enhancement", "Status: Triage"]
body:
- type: markdown
attributes:
value: >
Thanks for taking the time to fill out this enhancement proposal! Before submitting your issue, please make
sure there isn't already a prior issue concerning this. If there is, please join that discussion instead.
- type: textarea
id: enhancement-proposal
attributes:
label: Enhancement Proposal
description: >
Describe the enhancement you would like to see in as much detail as needed.
validations:
required: true
20 changes: 20 additions & 0 deletions .github/pull_request_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Applicable spec: <link>

### Overview

<!-- A high level overview of the change -->

### Rationale

<!-- The reason the change is needed -->

### Module Changes

<!-- Any high level changes to modules and why (Service, Observer, helper) -->

### Checklist

- [ ] The [contributing guide](https://github.com/canonical/is-charms-contributing-guide) was applied
- [ ] The PR is tagged with appropriate label (`urgent`, `trivial`, `complex`)

<!-- Explanation for any unchecked items above -->
10 changes: 10 additions & 0 deletions .github/workflows/bot_pr_approval.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Provide approval for bot PRs

on:
pull_request:

jobs:
bot_pr_approval:
uses: canonical/operator-workflows/.github/workflows/bot_pr_approval.yaml@main
secrets: inherit

12 changes: 12 additions & 0 deletions .github/workflows/comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Comment on the pull request

on:
workflow_run:
workflows: ["Tests"]
types:
- completed

jobs:
comment-on-pr:
uses: canonical/operator-workflows/.github/workflows/comment.yaml@main
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/comment_contributing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Comment on the pull request

on:
pull_request:
types:
- opened
branches:
- 'track/**'

jobs:
comment-on-pr:
uses: canonical/operator-workflows/.github/workflows/comment_contributing.yaml@main
secrets: inherit
11 changes: 11 additions & 0 deletions .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Sync issues to Jira

on:
issues:
# available via github.event.action
types: [opened, reopened, closed]

jobs:
issues-to-jira:
uses: canonical/operator-workflows/.github/workflows/jira.yaml@main
secrets: inherit
15 changes: 15 additions & 0 deletions .github/workflows/publish_charm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish to edge

on:
push:
branches:
- main
- track/*

jobs:
publish-to-edge:
uses: canonical/operator-workflows/.github/workflows/publish_charm.yaml@main
secrets: inherit
with:
integration-test-workflow-file: test.yaml
resource-mapping: '{"httprequest-lego-provider": "django-app-image"}'
18 changes: 18 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Tests

on:
pull_request:

jobs:
unit-tests:
uses: canonical/operator-workflows/.github/workflows/test.yaml@main
secrets: inherit
with:
self-hosted-runner: true
self-hosted-runner-label: "edge"
integration-tests:
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main
secrets: inherit
with:
channel: 1.28-strict/stable
juju-channel: 3.4/stable
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
venv/
build/
*.charm
.tox/
.coverage
__pycache__/
*.py[cod]
.idea
.vscode
.mypy_cache
*.egg-info/
**/*.rock
*/*.sqlite3
4 changes: 4 additions & 0 deletions .jujuignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/venv
*.py[cod]
*.charm
/.github
40 changes: 40 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
header:
license:
spdx-id: Apache-2.0
copyright-owner: Canonical Ltd.
content: |
Copyright [year] [owner]
See LICENSE file for licensing details.
paths:
- '**'
paths-ignore:
- '.github/**'
- '**/.gitkeep'
- '**/*.cfg'
- '**/*.conf'
- '**/*.j2'
- '**/*.json'
- '**/*.md'
- '**/*.rule'
- '**/*.tmpl'
- '**/*.txt'
- '.codespellignore'
- '.dockerignore'
- '.flake8'
- '.jujuignore'
- '.gitignore'
- '.licenserc.yaml'
- '.trivyignore'
- '.woke.yaml'
- '.woke.yml'
- 'CODEOWNERS'
- 'icon.svg'
- 'LICENSE'
- 'trivy.yaml'
- 'pyproject.toml'
- 'zap_rules.tsv'
- 'manage.py'
- 'app/**'
- 'charm/lib/**'
- '**/migrations/**'
comment: on-failure
3 changes: 3 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CVE-2022-40897

Check notice on line 1 in .trivyignore

View workflow job for this annotation

GitHub Actions / integration-tests / Scan Image (ghcr.io-canonical-httprequest-lego-provider-4619295c8e7bf50c42e278b1faa3c68012862ebe-_0.1_amd64.tar)

CVE-2022-40897 not present anymore, can be safely removed.
CVE-2024-6345

Check notice on line 2 in .trivyignore

View workflow job for this annotation

GitHub Actions / integration-tests / Scan Image (ghcr.io-canonical-httprequest-lego-provider-4619295c8e7bf50c42e278b1faa3c68012862ebe-_0.1_amd64.tar)

CVE-2024-6345 not present anymore, can be safely removed.
CVE-2024-34156 # https://github.com/canonical/pebble/issues/498
4 changes: 4 additions & 0 deletions .woke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignore_files:
# Ignore ingress charm library as it uses non compliant terminology:
# whitelist.
- charm/lib/charms/redis_k8s/v0/redis.py
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @canonical/is-charms
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Contributing

To make contributions to this charm, you'll need a working [development setup](https://juju.is/docs/sdk/dev-setup).

You can create an environment for development with `tox`:

```shell
tox devenv -e integration
source venv/bin/activate
```

## Testing

This project uses `tox` for managing test environments. There are some pre-configured environments
that can be used for linting and formatting code when you're preparing contributions to the charm:

```shell

Check warning on line 17 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / unit-tests / Style checker

[vale] reported by reviewdog 🐶 [Canonical.016-No-inline-comments] Avoid inline comments in code blocks. Raw Output: {"message": "[Canonical.016-No-inline-comments] Avoid inline comments in code blocks.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 17, "column": 1}}}, "severity": "WARNING"}
tox run -e format # update your code according to linting rules
tox run -e lint # code style
tox run -e unit # unit tests
tox run -e integration # integration tests
tox # runs 'format', 'lint', and 'unit' environments
```

## Build the charm

Build the charm in this git repository using:

```shell
charmcraft pack
```

<!-- You may want to include any contribution/style guidelines in this document>
Loading
Loading