-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
[17.0][WIP][MIG] connector_jira_servicedesk: Migration to 17.0 #109
Draft
SilvioC2C
wants to merge
24
commits into
OCA:17.0
Choose a base branch
from
camptocamp:17.0-mig-connector_jira_servicedesk
base: 17.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[17.0][WIP][MIG] connector_jira_servicedesk: Migration to 17.0 #109
SilvioC2C
wants to merge
24
commits into
OCA:17.0
from
camptocamp:17.0-mig-connector_jira_servicedesk
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SilvioC2C
force-pushed
the
17.0-mig-connector_jira_servicedesk
branch
4 times, most recently
from
July 10, 2024 09:58
13ba34c
to
116149e
Compare
Map projects by external_id + set of jira orgs Project bindings now can be assigned to one or more jira organizations. The binding for the project accept an additional argument for organizations. A task will be linked with the project having the exact same set of organizations that it has, or fallback to a project without organization. A constraint ensures that you cannot have several projects with the same set of organizations or 2 projects without organization. The link wizard has a new step to select the organization. The REST API for Serviced Desk is a different one. The former code was based on pycontribs/jira#388 which is closed and unmaintained. We only need to read the organizations from the servicedesk REST API and the local code is minimal. We can now use the normal jira library.
We should be able to have 2 bindings without external_id (not yet exported)
The unicity constraint (backend_id, odoo_id) on jira.backend.backend is relaxed: it now allows one binding of each type. The reason for this is: * supporting several projects of different types is a requirements (eg. 1 service desk and 1 software) * but if we implement new features like "if I create a task it is pushed to Jira", with different projects we would not know where to push them Using this constraint, we'll be able to focus new export features by project type.
The constraint did not look for inactive projects, which makes the import fail later because it finds several projects for the same task.
When a record does not exist on Jira: * the job is done instead of failed * a result on the job tells about the missing record * the binding is deleted on Odoo * for worklogs, the analytic line is deleted as well
We can compare the millisecond dates on both sides to see if any changes has been done on Jira and avoid useless writes. Previously, we were using the 'sync_date' field, which works too but will make more sync than necessary (because the sync happens after the last jira's updated_at value). Fortuitously, the updated_at is also very useful for debugging purposes.
The pagination specs of the servicedesk API are not the same than the Jira API (respectively isLastPage vs lastPage). So the lib's _fetch_pages does not fetch all the pages. Optimize the requests: we get all the data at the initial call, so the records are passed directly to "import_record" which will not do another request.
Update connector_jira_servicedesk/models/account_analytic_line/common.py Co-authored-by: Stéphane Mangin <[email protected]> Update connector_jira_servicedesk/tests/test_import_organization.py Co-authored-by: Stéphane Mangin <[email protected]> Update connector_jira_servicedesk/tests/common.py Co-authored-by: Stéphane Mangin <[email protected]> Update connector_jira_servicedesk/i18n/connector_jira_servicedesk.pot Co-authored-by: Stéphane Mangin <[email protected]> Update connector_jira_servicedesk/models/account_analytic_line/importer.py Co-authored-by: Stéphane Mangin <[email protected]>
SilvioC2C
force-pushed
the
17.0-mig-connector_jira_servicedesk
branch
from
July 11, 2024 13:48
116149e
to
7d66cef
Compare
SilvioC2C
force-pushed
the
17.0-mig-connector_jira_servicedesk
branch
from
July 17, 2024 14:14
7d66cef
to
79aa6b1
Compare
yankinmax
approved these changes
Sep 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migration based on top of #108