Skip to content
Draft
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
1 change: 0 additions & 1 deletion .description
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<a href="https://no.wikipedia.org/wiki/User:UKBot">UKBot</a> is a bot for updating results in weekly contests held at Norwegian and Finnish Wikipedia (<a href="github.com/danmichaelo/UKBot">source</a>)

2 changes: 1 addition & 1 deletion .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ DB_PASSWORD=ukbot
MW_CONSUMER_TOKEN=
MW_CONSUMER_SECRET=
MW_ACCESS_TOKEN=
MW_ACCESS_SECRET=
MW_ACCESS_SECRET=
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Describe what happens when you follow the steps above.
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ A clear and concise description of one or more use cases. Ex. As a ..., I want t
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature request here.
12 changes: 6 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Description

<!--
Please do not leave this blank
This PR [adds/removes/fixes/replaces] the [feature/bug/etc].
<!--
Please do not leave this blank
This PR [adds/removes/fixes/replaces] the [feature/bug/etc].
-->

## What type of PR is this? (check all applicable)
Expand All @@ -21,7 +21,7 @@ This PR [adds/removes/fixes/replaces] the [feature/bug/etc].

## Related Tickets & Documents

<!--
<!--
Please use this format link issue numbers: Fixes #123
-->

Expand All @@ -39,6 +39,6 @@ Please use this format link issue numbers: Fixes #123

## [optional] Are there any pre- or post-deployment tasks we need to perform?

<!--
<!--
Write about changing templates or modules on-wiki in order to accomodate changes in this PR
-->
-->
32 changes: 32 additions & 0 deletions .github/workflows/check-format-and-typing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Code formatting and typing

on:
pull_request:
branches:
- main

jobs:
CodeFormattingAndTyping:
name: Code formatting and typing
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3

- name: Install Python 3
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt

- name: check format using pycodestyle (ignore error on line length>79)
id: formatChecks
run: flake8 ukbot

- name: mypy static type checker
run: mypy ukbot
27 changes: 27 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "CodeQL"

on:
schedule:
- cron: "40 2 * * 1"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: ["python"]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
31 changes: 31 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run Tests
on:
workflow_dispatch:
pull_request:
branches:
- main

jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3

- name: Install Python 3
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
pip install -e .

- name: Run tests with pytest
run: coverage run -m pytest test

- name: Print coverage report
run: coverage report -m
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-docstring-first
- id: check-added-large-files
- id: check-case-conflict
- id: debug-statements
- id: requirements-txt-fixer
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.6.0
hooks:
- id: autopep8
additional_dependencies: ['pycodestyle==2.10.0']
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.0
hooks:
- id: mypy
name: mypy ukbot
exclude: config/, locale/
entry: mypy ukbot/
pass_filenames: false
args: [--config-file=mypy.ini]
additional_dependencies:
- types-PyMySQL
- types-pytz
- types-PyYAML
- types-requests
- urllib3

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ python:
- 3.5
- 3.6

# command to install dependencies, e.g.
install:
# command to install dependencies, e.g.
install:
- pip install -r requirements.txt

script:
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
https://www.contributor-covenant.org/translations.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ We welcome all feature requests, whether to add new functionality to `UKBot` or

### βš™οΈ Close a Bug / Feature issue

We welcome contributions that help make `UKBot` bug free & improve the experience of our users. You can also find issues tagged `bug` or `enhancement`. Check out our [Code Contribution Guide](docs/Code_Contributions_Guidelines.md) to begin.
We welcome contributions that help make `UKBot` bug free & improve the experience of our users. You can also find issues tagged `bug` or `enhancement`. Check out our [Code Contribution Guide](docs/Code_Contributions_Guidelines.md) to begin.
2 changes: 1 addition & 1 deletion ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ The `bug report` and `feature request` issue templates are ready for you!
2. The `UKBot` member provides feedback as soon as possible.
3. A conversation or discussion between `UKBot` and the user.
4. A pull request related to the issue will close it.
5. Otherwise, we'll close the issue after seven days of no update.
5. Otherwise, we'll close the issue after seven days of no update.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include locale/*/*/*.mo
include locale/*/*/*.mo
1 change: 0 additions & 1 deletion MIT-LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div align="center">
<p>Created by <a href="https://github.com/danmichaelo">Dan Michael</a> and maintained with ❀︎ by <a href="https://github.com/WikimediaNorge/UKBot/graphs/contributors">contributors</a></p>
</div>

## Getting Started

Clone code from github
Expand Down Expand Up @@ -66,13 +66,12 @@ To modify the code and test it locally, you'll need to install it as a pip packa

## Deployment

The bot is deployed at [ToolForge](https://wikitech.wikimedia.org/wiki/Portal:Toolforge) under the "UKBot" account using
[Webservice](https://wikitech.wikimedia.org/wiki/Help:Toolforge/Web) and the [Toolforge Jobs Framework](https://wikitech.wikimedia.org/wiki/Portal:Toolforge/Admin/Kubernetes/Jobs_framework).
The bot is deployed at [ToolForge](https://wikitech.wikimedia.org/wiki/Portal:Toolforge) under the "UKBot" account using
[Webservice](https://wikitech.wikimedia.org/wiki/Help:Toolforge/Web) and the [Toolforge Jobs Framework](https://wikitech.wikimedia.org/wiki/Portal:Toolforge/Admin/Kubernetes/Jobs_framework).

See https://wikitech.wikimedia.org/wiki/Tool:UKBot for deployment notes.

## Other notes

Forenklet flytkart:
![Flowchart](https://github.com/danmichaelo/UKBot/raw/master/flowchart.png)

1 change: 0 additions & 1 deletion config/config.en.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
_extends: sites/enwiki.yml

2 changes: 1 addition & 1 deletion config/config.es-estonia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ plot:
== {{int:license-header}} ==
{{PD-self}}

[[Category:Wikipedia competitions]]
[[Category:Wikipedia competitions]]
4 changes: 2 additions & 2 deletions config/config.fi-100.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ plot:
|Date = %(start)s
|Author = [[User:UKBot|UKBot]]
}}

== {{int:license-header}} ==
{{PD-self}}

[[Category:Viikon kilpailu]]
4 changes: 2 additions & 2 deletions config/config.fi-ek.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ plot:
|Date = %(start)s
|Author = [[User:UKBot|UKBot]]
}}

== {{int:license-header}} ==
{{PD-self}}

[[Category:Elokuun kuvitustalkoot]]
4 changes: 2 additions & 2 deletions config/config.fi-hl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ plot:
|Date = %(start)s
|Author = [[User:UKBot|UKBot]]
}}

== {{int:license-header}} ==
{{PD-self}}

[[Category:HeinΓ€kuun lΓ€hdetalkoot]]
4 changes: 2 additions & 2 deletions config/config.fi-pln.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ plot:
|Date = %(start)s
|Author = [[User:UKBot|UKBot]]
}}

== {{int:license-header}} ==
{{PD-self}}

[[Category:Wikipedia contests of Finnish Wikipedia]]
4 changes: 2 additions & 2 deletions config/config.fi-vk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ plot:
|Date = %(start)s
|Author = [[User:UKBot|UKBot]]
}}

== {{int:license-header}} ==
{{PD-self}}

[[Category:Viikon kilpailu %(year)s]]
awards:
sininen: { file: Article blue.svg, winner: true }
Expand Down
2 changes: 1 addition & 1 deletion config/config.gl-estonia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ plot:
== {{int:license-header}} ==
{{PD-self}}

[[Category:Wikipedia competitions]]
[[Category:Wikipedia competitions]]
4 changes: 2 additions & 2 deletions config/config.no-fd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ plot:
|Date = %(start)s
|Author = [[User:UKBot|UKBot]]
}}

== {{int:license-header}} ==
{{PD-self}}

[[Category:Fiks det!]]
awards:
blΓ₯: { file: FD-premie blΓ₯.svg, winner: true }
Expand Down
4 changes: 2 additions & 2 deletions config/config.no-mk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ plot:
|Date = %(start)s
|Author = [[User:UKBot|UKBot]]
}}

== {{int:license-header}} ==
{{PD-self}}

[[Category:MΓ₯nedens konkurranse %(year)s]]
4 changes: 2 additions & 2 deletions config/config.no-uk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ plot:
|Date = %(start)s
|Author = [[User:UKBot|UKBot]]
}}

== {{int:license-header}} ==
{{PD-self}}

[[Category:Ukens konkurranse %(year)s]]
4 changes: 2 additions & 2 deletions config/config.se.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ plot:
|Date = %(start)s
|Author = [[User:UKBot|UKBot]]
}}

== {{int:license-header}} ==
{{PD-self}}

[[Category:Wikipedia contests]]
awards:
sininen: { file: Article blue.svg, winner: true }
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ services:
# - ./:/src
volumes:
db:
driver: local
driver: local
13 changes: 12 additions & 1 deletion docs/Code_Contributions_Guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,15 @@ We use [GitHub Flow](https://guides.github.com/introduction/flow/index.html), so
6. When you raise a pull request, we automatically run tests on our CI. Please ensure that all the tests are passing for your code change. We will not be able to accept your change if the test suite doesn't pass.

## 🏑 Setup for local development
- In progress
Install packages needed for development
```bash
pip install -r requirements.txt -r requirements_dev.txt
```
Install [pre-commit](https://pre-commit.com/)
```bash
pre-commit install
```
When you have done your changes pre-commit will run when running `git commit`. To run it whenever you want type:
```bash
pre-commit run --all-files
```
Loading