Skip to content

Commit 0b1f513

Browse files
Add Simplified Linear Toolkit (#465)
This PR adds a simplified Linear toolkit focused on core functionality: ## What's Included **Tools:** - `get_issue` - Get detailed information about Linear issues - `get_teams` - Get team information and details **Models:** - `DateRange` enum with comprehensive date range support (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR, LAST_YEAR, LAST_7_DAYS, LAST_30_DAYS) - Timezone-aware datetime handling following Google toolkit patterns ## What's Simplified This toolkit has been streamlined by removing: - Cycles management tools - Projects management tools - Users management tools - Workflows management tools - Corresponding tests and evaluations for removed features ## Quality Assurance - All linting and formatting checks pass - Comprehensive test coverage for included functionality - Follows established patterns from Google toolkit --------- Co-authored-by: Eric Gustin <34000337+EricGustin@users.noreply.github.com>
1 parent cb7b386 commit 0b1f513

24 files changed

+2524
-0
lines changed

docker/docker.engine.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ auth:
133133
client_id: ${env:LINKEDIN_CLIENT_ID}
134134
client_secret: ${env:LINKEDIN_CLIENT_SECRET}
135135

136+
- id: arcade-linear
137+
description: "The Linear provider for Arcade"
138+
enabled: false
139+
type: oauth2
140+
provider_id: linear
141+
client_id: ${env:LINEAR_CLIENT_ID}
142+
client_secret: ${env:LINEAR_CLIENT_SECRET}
143+
136144
- id: default-microsoft
137145
description: "The default Microsoft provider"
138146
enabled: false

docker/env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ GOOGLE_CLIENT_SECRET=
1515
LINKEDIN_CLIENT_ID=
1616
LINKEDIN_CLIENT_SECRET=""
1717

18+
LINEAR_CLIENT_ID=
19+
LINEAR_CLIENT_SECRET=
20+
1821
MICROSOFT_CLIENT_ID=
1922
MICROSOFT_CLIENT_SECRET=""
2023

docker/toolkits.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ arcade-github
66
arcade-google
77
arcade-hubspot
88
arcade-jira
9+
arcade-linear
910
arcade-linkedin
1011
arcade-math
1112
arcade-microsoft
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
files: ^.*/linear/.*
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: "v4.4.0"
5+
hooks:
6+
- id: check-case-conflict
7+
- id: check-merge-conflict
8+
- id: check-toml
9+
- id: check-yaml
10+
- id: end-of-file-fixer
11+
- id: trailing-whitespace
12+
13+
- repo: https://github.com/astral-sh/ruff-pre-commit
14+
rev: v0.6.7
15+
hooks:
16+
- id: ruff
17+
args: [--fix]
18+
- id: ruff-format

toolkits/linear/.ruff.toml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
target-version = "py310"
2+
line-length = 100
3+
fix = true
4+
5+
[lint]
6+
select = [
7+
# flake8-2020
8+
"YTT",
9+
# flake8-bandit
10+
"S",
11+
# flake8-bugbear
12+
"B",
13+
# flake8-builtins
14+
"A",
15+
# flake8-comprehensions
16+
"C4",
17+
# flake8-debugger
18+
"T10",
19+
# flake8-simplify
20+
"SIM",
21+
# isort
22+
"I",
23+
# mccabe
24+
"C90",
25+
# pycodestyle
26+
"E", "W",
27+
# pyflakes
28+
"F",
29+
# pygrep-hooks
30+
"PGH",
31+
# pyupgrade
32+
"UP",
33+
# ruff
34+
"RUF",
35+
# tryceratops
36+
"TRY",
37+
]
38+
39+
[lint.per-file-ignores]
40+
"*" = ["TRY003"]
41+
"**/tests/*" = ["S101"]
42+
43+
[format]
44+
preview = true
45+
skip-magic-trailing-comma = false

toolkits/linear/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Arcade
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

toolkits/linear/Makefile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.PHONY: help
2+
3+
help:
4+
@echo "🛠️ Linear Commands:\n"
5+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6+
7+
.PHONY: install
8+
install: ## Install the uv environment and install all packages with dependencies
9+
@echo "🚀 Creating virtual environment and installing all packages using uv"
10+
@uv sync --active --all-extras --no-sources
11+
@if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi
12+
@echo "✅ All packages and dependencies installed via uv"
13+
14+
.PHONY: install-local
15+
install-local: ## Install the uv environment and install all packages with dependencies with local Arcade sources
16+
@echo "🚀 Creating virtual environment and installing all packages using uv"
17+
@uv sync --active --all-extras
18+
@if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi
19+
@echo "✅ All packages and dependencies installed via uv"
20+
21+
.PHONY: build
22+
build: clean-build ## Build wheel file using poetry
23+
@echo "🚀 Creating wheel file"
24+
uv build
25+
26+
.PHONY: clean-build
27+
clean-build: ## clean build artifacts
28+
@echo "🗑️ Cleaning dist directory"
29+
rm -rf dist
30+
31+
.PHONY: test
32+
test: ## Test the code with pytest
33+
@echo "🚀 Testing code: Running pytest"
34+
@uv run --no-sources pytest -W ignore -v --cov --cov-config=pyproject.toml --cov-report=xml
35+
36+
.PHONY: coverage
37+
coverage: ## Generate coverage report
38+
@echo "coverage report"
39+
@uv run --no-sources coverage report
40+
@echo "Generating coverage report"
41+
@uv run --no-sources coverage html
42+
43+
.PHONY: bump-version
44+
bump-version: ## Bump the version in the pyproject.toml file by a patch version
45+
@echo "🚀 Bumping version in pyproject.toml"
46+
uv version --no-sources --bump patch
47+
48+
.PHONY: check
49+
check: ## Run code quality tools.
50+
@if [ -f .pre-commit-config.yaml ]; then\
51+
echo "🚀 Linting code: Running pre-commit";\
52+
uv run --no-sources pre-commit run -a;\
53+
fi
54+
@echo "🚀 Static type checking: Running mypy"
55+
@uv run --no-sources mypy --config-file=pyproject.toml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Linear Toolkit for Arcade AI"""
2+
3+
from arcade_linear.models import DateRange
4+
from arcade_linear.tools import (
5+
get_issue, # Get specific issue details
6+
get_teams, # Get team information
7+
)
8+
9+
__all__ = [
10+
"DateRange",
11+
"get_issue",
12+
"get_teams",
13+
]

0 commit comments

Comments
 (0)