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

[13.0][MIG] connector jira servicedesk #61

Merged
merged 16 commits into from
Feb 16, 2021

Conversation

leemannd
Copy link
Contributor

No description provided.

@grindtildeath
Copy link
Contributor

Looks like we should still split the readme here

@guewen
Copy link
Member

guewen commented Feb 9, 2021

Looks like we should still split the readme here

this + check runbot (maybe a warning?)

p-tombez and others added 14 commits February 10, 2021 11:36
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.
@leemannd leemannd force-pushed the 13.0-mig-connector_jira_servicedesk branch from f8e4ef1 to ad50b6c Compare February 10, 2021 10:36
@leemannd
Copy link
Contributor Author

@guewen @simahawk The build is fixed. Could you review it?
I will squash it once I have your approvals

Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

LG. Squash pls

Copy link
Contributor

@StephaneMangin StephaneMangin left a comment

Choose a reason for hiding this comment

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

Pre-approval due to minor comments (maybe good to check for the test coverage btw)

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

1 similar comment
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

grindtildeath and others added 2 commits February 10, 2021 15:11
Update connector_jira_servicedesk/models/account_analytic_line/common.py

Co-authored-by: Stéphane Mangin <StephaneMangin@users.noreply.github.com>

Update connector_jira_servicedesk/tests/test_import_organization.py

Co-authored-by: Stéphane Mangin <StephaneMangin@users.noreply.github.com>

Update connector_jira_servicedesk/tests/common.py

Co-authored-by: Stéphane Mangin <StephaneMangin@users.noreply.github.com>

Update connector_jira_servicedesk/i18n/connector_jira_servicedesk.pot

Co-authored-by: Stéphane Mangin <StephaneMangin@users.noreply.github.com>

Update connector_jira_servicedesk/models/account_analytic_line/importer.py

Co-authored-by: Stéphane Mangin <StephaneMangin@users.noreply.github.com>
@leemannd leemannd force-pushed the 13.0-mig-connector_jira_servicedesk branch from 09cbfa5 to 3bd443a Compare February 10, 2021 14:12
@leemannd
Copy link
Contributor Author

@simahawk squashed. Ready to be merged

@leemannd
Copy link
Contributor Author

Hello @simahawk , this is ready for your merge :)

@simahawk
Copy link
Contributor

@leemannd likely you squashed too much on top of Add servicedesk_issue_url which contains many formatting changes...
Not a blocker. Just take into account next time 😉

@simahawk
Copy link
Contributor

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 13.0-ocabot-merge-pr-61-by-simahawk-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 14a083a into OCA:13.0 Feb 16, 2021
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 2a074f2. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants