stable

Clone or download

Read-only

refactor: use orElse() to create an integration

Part of story #26799 associate a Tuleap project and a GitLab group No functional change expected in synchronize REST route or POST gitlab_groups REST route. orElse() is meant to try to recover from an error. Here, we try to retrieve a repository integration for a given Tuleap Project and GitLab Project. We don't know if it exists; if it doesn't, it's ok, we will just create it. It is a good use case for orElse() because when the integration does not exist, it's perfectly normal, it just means we need to create it. In either case, we will then link the integration (new or existing) to our GroupLink. Change-Id: Id0b5209c64aa96e4f106c6527da20e92b2911cfe

Modified Files

Name
M plugins/gitlab/include/Repository/GitlabProjectIntegrator.php +45 −38 Go to diff View file
M plugins/gitlab/tests/unit/Repository/GitlabProjectIntegratorTest.php +6 −13 Go to diff View file