Skip to content

Dev - #31

Draft
fasteiner wants to merge 21 commits into
mainfrom
Dev
Draft

Dev#31
fasteiner wants to merge 21 commits into
mainfrom
Dev

Conversation

@fasteiner

Copy link
Copy Markdown
Owner

No description provided.

fasteinerand others added 18 commits April 13, 2026 20:57
… and Site modules
- Implement tests for OutOfOfficePeriod including initialization, data handling, CRUD operations, and filtering.
- Create tests for Product covering initialization, data handling, CRUD operations, enabling/disabling, and related entities.
- Add comprehensive tests for various referenced types including Service, Calendar, TimeAllocation, EffortClass, RequestTemplate, UiExtension, and WorkflowTemplate.
- Develop tests for ShopArticleCategory, ShopArticle, ShopOrderLine including initialization, data handling, CRUD operations, and filtering.
- Introduce tests for Site module covering initialization, data handling, CRUD operations, enabling/disabling, and archiving.
…jects, contracts, knowledge_articles, risks, service_offerings, skill_pools, closure_codes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: fasteiner <75947402+fasteiner@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: fasteiner <75947402+fasteiner@users.noreply.github.com>
- Requests: get_attachments, get_knowledge_articles, get_automation_rules,
get_satisfaction_feedback, get_tags, get_watches
- Tasks: get_notes, add_note, get_approvals, get_cis, get_predecessors,
get_successors, get_service_instances, get_automation_rules
- Workflows: get_notes, add_note, get_automation_rules, get_phases,
get_requests, get_problems
- People: get_cis, get_addresses, get_contacts, get_permissions,
get_ci_coverages, get_sla_coverages, get_service_coverages,
get_out_of_office_periods, get_skill_pools
- Organizations: get_addresses, get_contacts, get_contracts, get_risks,
get_slas, get_time_allocations
- Services: get_workflows, get_request_templates, get_risks,
get_service_instances, get_slas, get_service_offerings
- Calendars: get_duration, get_hours, get_holidays
- Teams: get_service_instances
- Holidays: get_calendars
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: fasteiner <75947402+fasteiner@users.noreply.github.com>
…exports
- Add search(), bulk_import(), list_archive(), list_trash(), list_audit_lines() methods to XurrentApiHelper
- Populate __init__.py with exports for all domain classes across all modules
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: fasteiner <75947402+fasteiner@users.noreply.github.com>
…methods
- test_problems.py: Problem CRUD, notes, requests, workflows
- test_service_instances.py: ServiceInstance CRUD, CIs, users
- test_releases.py: Release CRUD, archive/trash/restore, workflows, notes
- test_projects.py: Project CRUD, archive/trash/restore, tasks/phases/workflows/notes
- test_contracts.py: Contract CRUD, CIs
- test_knowledge_articles.py: KnowledgeArticle CRUD, archive/trash/restore, requests/service_instances/translations
- test_risks.py: Risk CRUD, archive/trash/restore, organizations/projects/services
- test_service_offerings.py: ServiceOffering CRUD
- test_skill_pools.py: SkillPool CRUD, enable/disable, members/effort_classes
- test_closure_codes.py: ClosureCode CRUD
- test_new_sub_resources.py: new sub-resource methods on Request, Task, Workflow,
Person, Organization, Service, Calendar, Holiday, Team; core search/bulk_import/
list_archive/list_trash/list_audit_lines utilities
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: fasteiner <75947402+fasteiner@users.noreply.github.com>
Add missing domain classes, sub-resource methods, and utility APIs to close gap vs Xurrent REST API v1
CopilotAI review requested due to automatic review settings May 13, 2026 15:02
@fasteiner

Copy link
Copy Markdown
OwnerAuthor

@copilot please fix by implementing lazy loading (like shown in various examples in the code on co dependant classes):

Run # Stop the build on syntax errors or undefined names
./src/xurrent/core.py:48:15: F821 undefined name 'Person'
api_user: Person # Forward declaration with a string
^
./src/xurrent/core.py:49:26: F821 undefined name 'Team'
api_user_teams: List[Team] # Forward declaration with a string
^
./src/xurrent/people.py:83:33: F821 undefined name 'Team'
def get_teams(self) -> List[Team]:
^
./src/xurrent/requests.py:80:24: F821 undefined name 'Workflow'
workflow: Optional[Workflow]
^
./src/xurrent/requests.py:105:37: F821 undefined name 'Workflow'
workflow: Optional[Workflow] = None,
^
./src/xurrent/requests.py:339:98: F821 undefined name 'ConfigurationItem'
def get_cis_by_request_id(cls, connection_object: XurrentApiHelper, request_id: int) -> List[ConfigurationItem]:
^
./src/xurrent/requests.py:386:31: F821 undefined name 'ConfigurationItem'
def get_cis(self) -> List[ConfigurationItem]:
^
./src/xurrent/tasks.py:76:26: F821 undefined name 'self'
uri += '?' + self._connection_object.create_filter_string(queryfilter)
^
./src/xurrent/tasks.py:87:12: F821 undefined name 'task'
if task.workflow and not expand:
^
./src/xurrent/tasks.py:89:14: F821 undefined name 'task'
elif task.workflow and expand:
^
./src/xurrent/tasks.py:91:18: F821 undefined name 'task'
elif not task.workflow:
^
./src/xurrent/workflows.py:111:128: F821 undefined name 'Task'
def get_workflow_tasks_by_workflow_id(cls, connection_object: XurrentApiHelper, id: int, queryfilter: dict = None) -> List[Task]:
^
./src/xurrent/workflows.py:118:59: F821 undefined name 'Task'
def get_tasks(self, queryfilter: dict = None) -> List[Task]:
^
./src/xurrent/workflows.py:130:126: F821 undefined name 'Task'
def get_workflow_task_by_template_id(cls, connection_object: XurrentApiHelper, workflowID: int, templateID: int) -> List[Task]:
^
./src/xurrent/workflows.py:137:64: F821 undefined name 'Task'
def get_task_by_template_id(self, templateID: int) -> List[Task]:
^
15 F821 undefined name 'Person'

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR significantly expands the Xurrent Python client by adding many new resource/domain modules (and sub-resource helper methods), alongside a broad set of unit tests and CI/release pipeline updates to support the expanded surface area.

Changes:

  • Added many new domain classes (e.g., Projects, Releases, Risks, ServiceInstances, Shop* resources, etc.) plus additional sub-resource convenience methods across existing models.
  • Added extensive unit test coverage for the new domain modules and sub-resource methods.
  • Updated packaging/metadata, documentation, changelog, and GitHub Actions workflows (tests + release automation).

Reviewed changes

Copilot reviewed 61 out of 62 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
tests/unit_tests/test_skill_pools.pyAdds unit tests for SkillPool CRUD and sub-resources.
tests/unit_tests/test_sites.pyAdds unit tests for Site CRUD and lifecycle methods.
tests/unit_tests/test_shop.pyAdds unit tests for shop article/category/order-line resources and enums.
tests/unit_tests/test_service_offerings.pyAdds unit tests for ServiceOffering CRUD/filtering.
tests/unit_tests/test_service_instances.pyAdds unit tests for ServiceInstance CRUD and sub-resources.
tests/unit_tests/test_risks.pyAdds unit tests for Risk CRUD/lifecycle and sub-resources.
tests/unit_tests/test_releases.pyAdds unit tests for Release CRUD/lifecycle and notes.
tests/unit_tests/test_referenced_types.pyAdds tests covering multiple referenced-type deserializations.
tests/unit_tests/test_projects.pyAdds unit tests for Project CRUD/lifecycle and sub-resources.
tests/unit_tests/test_products.pyAdds unit tests for Product CRUD/lifecycle and CI listing.
tests/unit_tests/test_problems.pyAdds unit tests for Problem CRUD/lifecycle and sub-resources.
tests/unit_tests/test_out_of_office_periods.pyAdds unit tests for OutOfOfficePeriod CRUD/DELETE.
tests/unit_tests/test_organizations.pyAdds unit tests for Organization CRUD/lifecycle and sub-resources.
tests/unit_tests/test_knowledge_articles.pyAdds unit tests for KnowledgeArticle CRUD/lifecycle and sub-resources.
tests/unit_tests/test_holidays.pyAdds unit tests for Holiday CRUD and filtering.
tests/unit_tests/test_custom_collections.pyAdds unit tests for custom collections/elements and listing.
tests/unit_tests/test_contracts.pyAdds unit tests for Contract CRUD/filtering and CI listing.
tests/unit_tests/test_closure_codes.pyAdds unit tests for ClosureCode CRUD.
src/xurrent/workflows.pyAdds workflow sub-resource helpers (notes, automation rules, phases, related items).
src/xurrent/workflow_templates.pyIntroduces WorkflowTemplate resource model and filters/enums.
src/xurrent/ui_extensions.pyIntroduces UiExtension resource model and category enum.
src/xurrent/time_allocations.pyIntroduces TimeAllocation resource model and category enums.
src/xurrent/teams.pyAdds Team.get_service_instances().
src/xurrent/tasks.pyAdds task sub-resource helpers (notes, approvals, CIs, links, automation rules).
src/xurrent/skill_pools.pyIntroduces SkillPool resource model and sub-resources.
src/xurrent/sites.pyIntroduces Site resource model including lifecycle methods.
src/xurrent/shop_order_lines.pyIntroduces ShopOrderLine resource model and enums.
src/xurrent/shop_articles.pyIntroduces ShopArticle resource model and enums.
src/xurrent/shop_article_categories.pyIntroduces ShopArticleCategory resource model and filters.
src/xurrent/services.pyIntroduces/extends Service resource model with multiple sub-resource methods.
src/xurrent/service_offerings.pyIntroduces ServiceOffering resource model and enums.
src/xurrent/service_instances.pyIntroduces ServiceInstance resource model and enums/sub-resources.
src/xurrent/risks.pyIntroduces Risk resource model and enums/sub-resources.
src/xurrent/requests.pyAdds several request sub-resource helper methods (attachments, tags, watches, etc.).
src/xurrent/request_templates.pyIntroduces RequestTemplate resource model and enums.
src/xurrent/releases.pyIntroduces Release resource model and enums/sub-resources.
src/xurrent/projects.pyIntroduces Project resource model and enums/sub-resources.
src/xurrent/products.pyIntroduces Product resource model and depreciation enum.
src/xurrent/product_categories.pyIntroduces ProductCategory resource model and rule-set enum.
src/xurrent/problems.pyIntroduces Problem resource model and enums/sub-resources.
src/xurrent/people.pyExtends Person deserialization and adds multiple sub-resource helper methods; fixes update() return type.
src/xurrent/out_of_office_periods.pyIntroduces OutOfOfficePeriod resource model and filters.
src/xurrent/organizations.pyIntroduces/extends Organization resource model with lifecycle + sub-resources.
src/xurrent/knowledge_articles.pyIntroduces KnowledgeArticle resource model and enums/sub-resources.
src/xurrent/holidays.pyIntroduces Holiday resource model and calendar listing.
src/xurrent/effort_classes.pyIntroduces EffortClass resource model and filter.
src/xurrent/custom_collections.pyIntroduces CustomCollection resource model and element listing.
src/xurrent/custom_collection_elements.pyIntroduces CustomCollectionElement resource model and filters.
src/xurrent/core.pyAdds helper endpoints (search, bulk_import, archive/trash/audit listings).
src/xurrent/contracts.pyIntroduces Contract resource model and enums/sub-resources.
src/xurrent/configuration_items.pyExtends ConfigurationItem to deserialize product.
src/xurrent/closure_codes.pyIntroduces ClosureCode resource model.
src/xurrent/calendars.pyIntroduces/extends Calendar resource model and helper endpoints.
src/xurrent/init.pyExposes many new classes/enums at package top-level.
pyproject.tomlBumps version; updates author; adds dependency groups metadata.
Contributing.mdAdds a changelog documentation reminder.
CLAUDE.mdAdds repository guidance for Claude Code (setup, commands, architecture).
CHANGELOG.mdDocuments newly added resources/methods and CI changes under Unreleased.
.gitignoreAdds uv.lock and .claude/ ignores; adjusts diff ignores.
.github/workflows/release.ymlUpdates release automation steps and action versions; adds Node24 env flag.
.github/workflows/python-package.ymlUpdates CI matrix, setup-python action, adds lint step, splits unit/integration tests.
Comments suppressed due to low confidence (1)

.github/workflows/release.yml:165

  • The workflow creates a git tag without the v prefix (git tag ${{ ...effective_version }}) but creates a GitHub Release for v${{ ...effective_version }}. This mismatch will fail because the release tag won't exist (or will produce two different tags). Make the tag name consistent (either tag with v... or remove the v prefix in the release step).
 - name: Create Git Tag
run: |
git tag ${{ steps.effective-version.outputs.effective_version }}
git push origin ${{ steps.effective-version.outputs.effective_version }}
- name: Create GitHub Release
if: env.python_changed == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.effective-version.outputs.effective_version }}
name: Release v${{ steps.effective-version.outputs.effective_version }}
body: "${{ steps.extract-changelog.outputs.release-notes }}"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/xurrent/core.py
Comment on lines +391 to +401
def search(self, query: str, types: list = None) -> list:
"""
Perform a cross-resource full-text search.
:param query: Search query string
:param types: Optional list of resource types to search (e.g. ['request', 'person'])
:return: List of search results
"""
uri = f'/search?q={query}'
if types:
uri += '&types=' + ','.join(types)
return self.api_call(uri, 'GET')

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 9961d9a. XurrentApiHelper.search() now builds the query string with URL encoding, and the related unit tests were updated to cover spaces and reserved characters.

Comment threadpyproject.toml
Comment thread.github/workflows/release.yml Outdated
Comment on lines 103 to 107
fi

echo "effective_version=$EFFECTIVE_VERSION" >> $GITHUB_ENV
echo "::set-output name=effective_version::$EFFECTIVE_VERSION"
echo "effective_version=$EFFECTIVE_VERSION" >> $GITHUB_OUTPUT

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 9961d9a. The release workflow now strips an optional leading v from the previous tag before splitting the version, so the forced patch bump works for both vX.Y.Z and X.Y.Z tags.

Agent-Logs-Url: https://github.com/fasteiner/xurrent-python/sessions/fa48e3dc-7f83-4675-944c-2cfe73efce6a
Co-authored-by: fasteiner <75947402+fasteiner@users.noreply.github.com>

CopilotAI commented May 13, 2026

Copy link
Copy Markdown

@copilot please fix by implementing lazy loading (like shown in various examples in the code on co dependant classes):

Run # Stop the build on syntax errors or undefined names
...

Addressed in f76ecf4. I switched the affected cross-module annotations to lazy-loaded forward references with TYPE_CHECKING imports where needed, and fixed the undefined self/task references in tasks.py. The CI-equivalent flake8 gate now passes locally.

Agent-Logs-Url: https://github.com/fasteiner/xurrent-python/sessions/af4e838f-ec7d-4f44-90d9-a48f0e7c8a1e
Co-authored-by: fasteiner <75947402+fasteiner@users.noreply.github.com>
@fasteiner
fasteiner marked this pull request as draft May 13, 2026 15:18
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@fasteiner