Skip to content

Commit afcf400

Browse files
authored
Merge pull request #124 from UiPath/chore/ci
Chore/ci
2 parents 3ae9762 + 1c65496 commit afcf400

File tree

19 files changed

+353
-128
lines changed

19 files changed

+353
-128
lines changed

.github/workflows/publish.yml renamed to .github/workflows/cd.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- pyproject.toml
1010

1111
jobs:
12+
lint:
13+
uses: ./.github/workflows/lint.yml
14+
1215
build:
1316
name: Build
1417
runs-on: ubuntu-latest

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths-ignore:
11+
- pyproject.toml
12+
pull_request:
13+
branches:
14+
- main
15+
16+
jobs:
17+
commit-lint:
18+
if: ${{ github.event_name == 'pull_request' }}
19+
uses: ./.github/workflows/commitlint.yml
20+
21+
lint:
22+
uses: ./.github/workflows/lint.yml

.github/workflows/commitlint.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Commit Lint
2+
3+
on:
4+
workflow_call
5+
6+
jobs:
7+
commitlint:
8+
name: Commit Lint
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 22
23+
24+
- name: Install Git
25+
run: |
26+
if ! command -v git &> /dev/null; then
27+
echo "Git is not installed. Installing..."
28+
sudo apt-get update
29+
sudo apt-get install -y git
30+
else
31+
echo "Git is already installed."
32+
fi
33+
34+
- name: Install commitlint
35+
run: |
36+
npm install conventional-changelog-conventionalcommits
37+
npm install commitlint@latest
38+
npm install @commitlint/config-conventional
39+
40+
- name: Configure
41+
run: |
42+
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
43+
44+
- name: Validate PR commits with commitlint
45+
run: |
46+
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr_branch
47+
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to pr_branch --verbose

.github/workflows/lint.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Lint
2+
3+
on:
4+
workflow_call
5+
6+
jobs:
7+
# Job that runs when custom version testing is enabled - just completes successfully
8+
skip-lint:
9+
name: Skip Lint (Custom Version Testing)
10+
runs-on: ubuntu-latest
11+
if: contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')
12+
permissions:
13+
contents: read
14+
steps:
15+
- name: Skip lint for custom version testing
16+
run: |
17+
echo "Custom version testing enabled - skipping normal lint process"
18+
echo "This job completes successfully to allow PR merging"
19+
20+
# Job that runs normal lint process when custom version testing is NOT enabled
21+
lint:
22+
name: Lint
23+
runs-on: ubuntu-latest
24+
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
25+
permissions:
26+
contents: read
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup uv
33+
uses: astral-sh/setup-uv@v5
34+
with:
35+
enable-cache: true
36+
37+
- name: Setup Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version-file: ".python-version"
41+
42+
- name: Install dependencies
43+
run: uv sync --all-extras
44+
45+
- name: Check static types
46+
run: uv run mypy --config-file pyproject.toml .
47+
48+
- name: Check linting
49+
run: uv run ruff check .
50+
51+
- name: Check formatting
52+
run: uv run ruff format --check .
53+

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ line-ending = "auto"
6464
plugins = [
6565
"pydantic.mypy"
6666
]
67+
exclude = [
68+
"samples/.*"
69+
]
6770

6871
follow_imports = "silent"
6972
warn_redundant_casts = true

samples/github-slack-agent/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def system_prompt(state: AgentState) -> AgentState:
108108
_This review was generated automatically._
109109
"""
110110

111-
return [{"role": "system", "content": system_message}] + state["messages"]
111+
return [{"role": "system", "content": system_message}] + state[
112+
"messages"
113+
]
112114

113115
agent = create_react_agent(
114116
model,

samples/mcp-functions-agent/builder.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,7 @@ async def validator_agent(state: GraphState) -> GraphState:
180180
**Example use case:** If the function reads files from disk, your setup function should create a temporary folder and write some files into it. Then, test the function against that folder path.
181181
"""
182182

183-
seeder = create_react_agent(
184-
model, tools=tools, prompt=test_case_prompt
185-
)
183+
seeder = create_react_agent(model, tools=tools, prompt=test_case_prompt)
186184

187185
test_result = await seeder.ainvoke(state)
188186

samples/mcp-functions-server/server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Initialize the MCP server
66
mcp = FastMCP("Code Functions MCP Server")
77

8+
89
# Functions registry to track dynamically added code functions
910
class FunctionRegistry:
1011
def __init__(self):

src/uipath_mcp/_cli/_runtime/_context.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class UiPathServerType(Enum):
5353
SelfHosted (3): Tunnel to externally hosted server
5454
"""
5555

56-
UiPath = 0 # type: int # Processes, Agents, Activities
57-
Command = 1 # type: int # npx, uvx
58-
Coded = 2 # type: int # PackageType.MCPServer
59-
SelfHosted = 3 # type: int # tunnel to externally hosted server
56+
UiPath = 0 # Processes, Agents, Activities
57+
Command = 1 # npx, uvx
58+
Coded = 2 # PackageType.MCPServer
59+
SelfHosted = 3 # tunnel to externally hosted server
6060

6161
@classmethod
6262
def from_string(cls, name: str) -> "UiPathServerType":

0 commit comments

Comments
 (0)