Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Integration][Jira] Adds teams kind #1227

Merged
merged 124 commits into from
Jan 13, 2025
Merged

Conversation

shariff-6
Copy link
Contributor

Description

What -
Added support for syncing Jira teams to Port.

Why -
Enhance the Jira integration by providing team-level information and context.
Enable users to track and manage Jira teams within their Port catalog.

How -
Added new methods in jira/client.py to fetch teams and team members.
Updated main.py to include team synchronization logic.
Modified configuration files to support team resource kind.
Implemented team enrichment for users through team mapping.

Type of change

Please leave one option from the following and delete the rest:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Integration (non-breaking change which adds a new integration)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

All tests should be run against the port production environment(using a testing org).

Core testing checklist

  • Integration able to create all default resources from scratch
  • Resync finishes successfully
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Scheduled resync able to abort existing resync and start a new one
  • Tested with at least 2 integrations from scratch
  • Tested with Kafka and Polling event listeners
  • Tested deletion of entities that don't pass the selector

Integration testing checklist

  • Integration able to create all default resources from scratch
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Resync finishes successfully
  • If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the examples folder in the integration directory.
  • If resource kind is updated, run the integration with the example data and check if the expected result is achieved
  • If new resource kind is added or updated, validate that live-events for that resource are working as expected
  • Docs PR link here

Preflight checklist

  • Handled rate limiting
  • Handled pagination
  • Implemented the code in async
  • Support Multi account

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.

shariff-6 and others added 30 commits December 3, 2024 14:59
- Implement `get_paginated_users` method to fetch users from Jira API
- Add `_get_paginated_users` helper method to retrieve user data
- Extended `WEBHOOK_EVENTS` to include user lifecycle events
- Updated `handle_webhook_request` to process user webhook events
- Register user data  when user-related events are received
- Generalized event processing using `startswith` for different event types.
- Added error handling for unknown events and missing items.
- Improved logging and ensured proper registration/unregistration of items.
…le different webhook event types (user, project, issue).
- Added `TEAM` to `ObjectKind` enum.
- Introduced `on_resync_teams` for syncing teams
- Enhanced `on_resync_users` to enrich users with associated team data
- Added `team` to the list of resource kinds in the spec.
- Introduced `atlassianOrganisationId` as an optional configuration for teams support
- Added `_send_api_request` for centralized API request logic.
- Implemented `_get_paginated_data` and `_get_cursor_paginated_data` for streamlined handling of paginated responses.
- Replaced repetitive API calls with reusable helper methods.
- Updated methods (`get_paginated_projects`, `get_paginated_issues`, etc.) to use new pagination utilities.
- Improved logging for better traceability during data retrieval.
- Simplified user and team data fetching with cursor-based pagination support.
- Introduced `jiraTeam` blueprint with properties:
  - `displayName`, `organizationId`, `teamType`, and `description`.
  - Added `members` relation linking `jiraTeam` to `jiraUser`.
- Updated `jiraUser` blueprint:
  - Added `team` relation linking users to their teams.
- Introduced a new `team` resource to the configuration with a selector to map teams.
- Updated `user` resource to include a `team` relation linking users to teams using `teamId`.
…e effects.

- Improved pagination logic by dynamically updating `start_at` based on fetched items.
…}` for clarity.

- Ensured `params` defaults to `{}` when `None` is provided across methods.
integrations/jira/.port/spec.yaml Outdated Show resolved Hide resolved
integrations/jira/CHANGELOG.md Outdated Show resolved Hide resolved
integrations/jira/CHANGELOG.md Outdated Show resolved Hide resolved
integrations/jira/.port/spec.yaml Outdated Show resolved Hide resolved
integrations/jira/main.py Outdated Show resolved Hide resolved
integrations/jira/jira/overrides.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Tankilevitch Tankilevitch left a comment

Choose a reason for hiding this comment

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

Nice work @shariff-6 !

Copy link
Contributor

@PeyGis PeyGis left a comment

Choose a reason for hiding this comment

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

great job

Copy link
Contributor

@lordsarcastic lordsarcastic left a comment

Choose a reason for hiding this comment

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

LGTM

@PeyGis PeyGis removed the request for review from matan84 January 13, 2025 10:17
@shariff-6 shariff-6 requested a review from matan84 January 13, 2025 10:34
@Tankilevitch Tankilevitch dismissed matan84’s stale review January 13, 2025 11:20

approved offline

@Tankilevitch Tankilevitch merged commit 068cd17 into main Jan 13, 2025
18 checks passed
@Tankilevitch Tankilevitch deleted the PORT-11704-Jira-enhancements branch January 13, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants