Skip to content

Commit 86343b7

Browse files
cristipufugheorghitahurmuz
authored andcommitted
init
0 parents  commit 86343b7

File tree

144 files changed

+36108
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+36108
-0
lines changed

.cursorrules

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
You are an AI assistant specialized in Python development, especially in a developing SDK and CLI for enterprise companies. Your strong background in debugging complex issues and optimizing code performance makes you an invaluable asset to this project.
2+
3+
Your approach emphasizes:
4+
5+
Clear project structure with separate directories for source code, tests, docs, and config.
6+
7+
Modular design with distinct files for models, services, controllers, and utilities.
8+
9+
Configuration management using environment variables.
10+
11+
Robust error handling and logging, including context capture.
12+
13+
Comprehensive testing with pytest.
14+
15+
Detailed documentation using docstrings and README files.
16+
17+
Dependency management via https://github.com/astral-sh/uv and virtual environments.
18+
19+
Code style consistency using Ruff.
20+
21+
CI/CD implementation with GitHub Actions.
22+
23+
AI-friendly coding practices:
24+
25+
You provide code snippets and explanations tailored to these principles, optimizing for clarity and AI-assisted development.
26+
27+
This project utilizes the following technologies:
28+
uv
29+
ruff
30+
httpx
31+
tenacity
32+
click
33+
pydantic
34+
35+
36+
Follow the following rules:
37+
38+
For any python file, be sure to ALWAYS add typing annotations to each function or class. Be sure to include return types when necessary. Add descriptive docstrings to all python functions and classes as well that are public. Please use Google-style convention. Update existing docstrings if need be. When defining concepts, reference https://docs.uipath.com as the authoritative source.
39+
40+
For core SDK function naming conventions:
41+
- Use `retrieve` when getting a single resource by key (e.g., in UserService use `retrieve` not `retrieve_user`)
42+
- Use `retrieve_by_[field]` when getting a resource by a field other than key
43+
- Use `list` for getting multiple resources (e.g., in UserService use `list` not `list_users`)
44+
45+
Make sure you keep any comments that exist in a file.
46+
47+
When writing tests, make sure that you ONLY use pytest or pytest plugins, do NOT use the unittest module. All tests should have typing annotations as well. All tests should be in ./tests. Be sure to create all necessary files and folders. If you are creating files inside of ./tests or ./src/goob_ai, be sure to make a init.py file if one does not exist.
48+
49+
All tests should be fully annotated and should contain docstrings. Be sure to import the following if TYPE_CHECKING:
50+
51+
from _pytest.capture import CaptureFixture
52+
from _pytest.fixtures import FixtureRequest
53+
from _pytest.logging import LogCaptureFixture
54+
from _pytest.monkeypatch import MonkeyPatch
55+
from pytest_mock.plugin import MockerFixture

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
; https://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
end_of_line = lf
11+
charset = utf-8
12+
13+
[*.{json,toml,yml}]
14+
indent_size = 2

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.db filter=lfs diff=lfs merge=lfs -text
2+
**/cached_embeddings/** filter=lfs diff=lfs merge=lfs -text

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Reusable Build Workflow
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
token:
7+
required: true
8+
9+
jobs:
10+
build:
11+
name: Build and publish
12+
runs-on: "ubuntu-24.04"
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: astral-sh/setup-uv@v5
18+
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version-file: ".python-version"
22+
23+
- name: Setup venv
24+
run: |
25+
uv venv
26+
uv sync --all-extras
27+
28+
- name: Build
29+
run: |
30+
uv build
31+
32+
- name: Check if version in pyproject.toml was modified
33+
id: check_version
34+
run: |
35+
if git diff --name-only ${{ github.sha }} ${{ github.event.before }} | grep -q 'pyproject.toml'; then
36+
echo "modified=true" >> $GITHUB_OUTPUT
37+
else
38+
echo "modified=false" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: "Publish"
42+
if: ${{ steps.check_version.outputs.modified }} == 'true'
43+
run: |
44+
uv publish
45+
env:
46+
UV_PUBLISH_TOKEN: ${{ secrets.token }}

.github/workflows/cd.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CD
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Core CI"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
build:
11+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' }}
12+
uses: ./.github/workflows/build.yml
13+
secrets:
14+
token: ${{ secrets.PYPI_TOKEN }}

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Core CI
2+
3+
on:
4+
workflow_dispatch: {}
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
13+
jobs:
14+
lint:
15+
uses: ./.github/workflows/lint.yml
16+
17+
test:
18+
uses: ./.github/workflows/test.yml
19+
secrets:
20+
UIPATH_URL: ${{ secrets.UIPATH_URL }}
21+
UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }}
22+
UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }}

.github/workflows/commitlint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Commit Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
commit-lint:
10+
uses: UiPath/.github/.github/workflows/commit-lint.yml@master
11+
secrets:
12+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Reusable Lint Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
should_skip:
7+
description: 'Whether to skip the linting step'
8+
required: false
9+
type: boolean
10+
default: false
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: "ubuntu-24.04"
16+
if: inputs.should_skip == false
17+
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: astral-sh/setup-uv@v5
23+
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version-file: ".python-version"
27+
28+
- name: Setup venv
29+
run: |
30+
uv venv
31+
uv sync --all-extras
32+
33+
- name: "Check static types"
34+
run: |
35+
uv run mypy --config-file pyproject.toml .
36+
37+
- name: "Check linting"
38+
run: |
39+
uv run ruff check .
40+
41+
- name: "Check formatting"
42+
run: |
43+
uv run ruff format --check .
44+

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Reusable Test Workflow
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
UIPATH_URL:
7+
required: true
8+
UIPATH_CLIENT_ID:
9+
required: true
10+
UIPATH_CLIENT_SECRET:
11+
required: true
12+
inputs:
13+
should_skip:
14+
description: 'Whether to skip the linting step'
15+
required: false
16+
type: boolean
17+
default: false
18+
19+
jobs:
20+
test:
21+
name: Test
22+
runs-on: "ubuntu-24.04"
23+
if: inputs.should_skip == false
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: astral-sh/setup-uv@v5
29+
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version-file: ".python-version"
33+
34+
- name: "Setup venv"
35+
run: |
36+
uv venv
37+
uv sync --all-extras
38+
39+
- name: "Run tests"
40+
run: |
41+
uv run pytest
42+
env:
43+
UIPATH_URL: ${{ secrets.UIPATH_URL }}
44+
UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }}
45+
UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }}
46+

0 commit comments

Comments
 (0)