Skip to content

Commit 7949d10

Browse files
authored
Merge pull request #1 from itk-dev-rpa/feature/first
Feature/first
2 parents c11c39d + a4ad91d commit 7949d10

File tree

15 files changed

+318
-385
lines changed

15 files changed

+318
-385
lines changed

.github/workflows/changelog.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check Changelog
2+
3+
on: pull_request
4+
5+
jobs:
6+
changelog:
7+
runs-on: ubuntu-latest
8+
name: Changelog should be updated
9+
strategy:
10+
fail-fast: false
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 2
16+
17+
- name: Git fetch
18+
run: git fetch
19+
20+
- name: Check that changelog has been updated.
21+
run: git diff --exit-code origin/${{ github.base_ref }} -- changelog.md && exit 1 || exit 0

.github/workflows/version.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Check pyproject.toml Version Change
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
check-version:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v3
11+
12+
- name: Get current version in PR branch
13+
id: get-pr-version
14+
run: |
15+
PR_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml)
16+
echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV
17+
18+
- name: Get version in base branch
19+
id: get-base-version
20+
run: |
21+
git fetch origin ${{ github.event.pull_request.base.ref }}
22+
git checkout FETCH_HEAD
23+
BASE_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml)
24+
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV
25+
26+
- name: Compare versions
27+
run: |
28+
echo "PR version: ${{ env.PR_VERSION }}"
29+
echo "Base branch version: ${{ env.BASE_VERSION }}"
30+
31+
if [ "${{ env.PR_VERSION }}" == "${{ env.BASE_VERSION }}" ]; then
32+
echo "Version number has not been changed."
33+
exit 1
34+
else
35+
echo "Version number has changed."
36+
fi

README.md

Lines changed: 14 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,22 @@
1-
# Robot-Framework V3
1+
# RPA - Fritagelse for leverandørmodregning
22

3-
This repo is meant to be used as a template for robots made for [OpenOrchestrator](https://github.com/itk-dev-rpa/OpenOrchestrator).
3+
This robot is used to allow employees without access to SAP to order automated changed to "Leverandørmodregning".
4+
The robot is activated using an OS2Forms formula which delivers an email.
45

5-
## Quick start
6+
## Output
67

7-
1. To use this template simply use this repo as a template (see [Creating a repository from a template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)).
8-
__Don't__ include all branches.
8+
If a task is invalid an email is sent to the original sender.
99

10-
2. Go to `robot_framework/__main__.py` and choose between the linear framework or queue based framework.
10+
When a task is completed an email is sent to the original sender.
1111

12-
3. Implement all functions in the files:
13-
* `robot_framework/initialize.py`
14-
* `robot_framework/reset.py`
15-
* `robot_framework/process.py`
12+
## Arguments
1613

17-
4. Change `config.py` to your needs.
14+
The robot expects the following arguments:
1815

19-
5. Fill out the dependencies in the `pyproject.toml` file with all packages needed by the robot.
20-
21-
6. Feel free to add more files as needed. Remember that any additional python files must
22-
be located in the folder `robot_framework` or a subfolder of it.
23-
24-
When the robot is run from OpenOrchestrator the `main.py` file is run which results
25-
in the following:
26-
1. The working directory is changed to where `main.py` is located.
27-
2. A virtual environment is automatically setup with the required packages.
28-
3. The framework is called passing on all arguments needed by [OpenOrchestrator](https://github.com/itk-dev-rpa/OpenOrchestrator).
29-
30-
## Requirements
31-
Minimum python version 3.10
32-
33-
## Flow
34-
35-
This framework contains two different flows: A linear and a queue based.
36-
You should only ever use one at a time. You choose which one by going into `robot_framework/__main__.py`
37-
and uncommenting the framework you want. They are both disabled by default and an error will be
38-
raised to remind you if you don't choose.
39-
40-
### Linear Flow
41-
42-
The linear framework is used when a robot is just going from A to Z without fetching jobs from an
43-
OpenOrchestrator queue.
44-
The flow of the linear framework is sketched up in the following illustration:
45-
46-
![Linear Flow diagram](Robot-Framework.svg)
47-
48-
### Queue Flow
49-
50-
The queue framework is used when the robot is doing multiple bite-sized tasks defined in an
51-
OpenOrchestrator queue.
52-
The flow of the queue framework is sketched up in the following illustration:
53-
54-
![Queue Flow diagram](Robot-Queue-Framework.svg)
55-
56-
## Linting and Github Actions
57-
58-
This template is also setup with flake8 and pylint linting in Github Actions.
59-
This workflow will trigger whenever you push your code to Github.
60-
The workflow is defined under `.github/workflows/Linting.yml`.
16+
```json
17+
{
18+
"approved_senders": ["az12345", "az98765"]
19+
}
20+
```
6121

22+
__approved_senders__: A whitelist of people who are allowed to activate the robot.

Robot-Framework.drawio

Lines changed: 0 additions & 115 deletions
This file was deleted.

Robot-Framework.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)