Skip to content
Merged
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
21 changes: 21 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Changelog

on: pull_request

jobs:
changelog:
runs-on: ubuntu-latest
name: Changelog should be updated
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Git fetch
run: git fetch

- name: Check that changelog has been updated.
run: git diff --exit-code origin/${{ github.base_ref }} -- changelog.md && exit 1 || exit 0
36 changes: 36 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check pyproject.toml Version Change

on: [pull_request]

jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get current version in PR branch
id: get-pr-version
run: |
PR_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml)
echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV

- name: Get version in base branch
id: get-base-version
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
git checkout FETCH_HEAD
BASE_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml)
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV

- name: Compare versions
run: |
echo "PR version: ${{ env.PR_VERSION }}"
echo "Base branch version: ${{ env.BASE_VERSION }}"

if [ "${{ env.PR_VERSION }}" == "${{ env.BASE_VERSION }}" ]; then
echo "Version number has not been changed."
exit 1
else
echo "Version number has changed."
fi
67 changes: 14 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,22 @@
# Robot-Framework V3
# RPA - Fritagelse for leverandørmodregning

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

## Quick start
## Output

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)).
__Don't__ include all branches.
If a task is invalid an email is sent to the original sender.

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

3. Implement all functions in the files:
* `robot_framework/initialize.py`
* `robot_framework/reset.py`
* `robot_framework/process.py`
## Arguments

4. Change `config.py` to your needs.
The robot expects the following arguments:

5. Fill out the dependencies in the `pyproject.toml` file with all packages needed by the robot.

6. Feel free to add more files as needed. Remember that any additional python files must
be located in the folder `robot_framework` or a subfolder of it.

When the robot is run from OpenOrchestrator the `main.py` file is run which results
in the following:
1. The working directory is changed to where `main.py` is located.
2. A virtual environment is automatically setup with the required packages.
3. The framework is called passing on all arguments needed by [OpenOrchestrator](https://github.com/itk-dev-rpa/OpenOrchestrator).

## Requirements
Minimum python version 3.10

## Flow

This framework contains two different flows: A linear and a queue based.
You should only ever use one at a time. You choose which one by going into `robot_framework/__main__.py`
and uncommenting the framework you want. They are both disabled by default and an error will be
raised to remind you if you don't choose.

### Linear Flow

The linear framework is used when a robot is just going from A to Z without fetching jobs from an
OpenOrchestrator queue.
The flow of the linear framework is sketched up in the following illustration:

![Linear Flow diagram](Robot-Framework.svg)

### Queue Flow

The queue framework is used when the robot is doing multiple bite-sized tasks defined in an
OpenOrchestrator queue.
The flow of the queue framework is sketched up in the following illustration:

![Queue Flow diagram](Robot-Queue-Framework.svg)

## Linting and Github Actions

This template is also setup with flake8 and pylint linting in Github Actions.
This workflow will trigger whenever you push your code to Github.
The workflow is defined under `.github/workflows/Linting.yml`.
```json
{
"approved_senders": ["az12345", "az98765"]
}
```

__approved_senders__: A whitelist of people who are allowed to activate the robot.
115 changes: 0 additions & 115 deletions Robot-Framework.drawio

This file was deleted.

3 changes: 0 additions & 3 deletions Robot-Framework.svg

This file was deleted.

Loading