[ 
https://issues.apache.org/jira/browse/NIFI-15849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Evgeny updated NIFI-15849:
--------------------------
    Description: 
Good afternoon!

While configuring integration with Bitbucket (Data Center), I ran into the 
problem that when filling in all the necessary fields in versioning and 
applying the changes, I get the error "{*}Failed to remove flow from Flow 
Registry due to Could not parse response from Bitbucket API{*}". At the same 
time, I observe that a commit has appeared in the repository. An AI suggested 
making the following corrections to the source code: in the 
BitbucketRepositoryClient.java replace this block of code
{code:java}
  final String expectedCommitSha = request.getExpectedCommitSha();
  if (expectedCommitSha != null && !expectedCommitSha.isBlank()) {
      multipartBuilder.addPart(FIELD_SOURCE_COMMIT_ID, 
StandardHttpContentType.TEXT_PLAIN, 
expectedCommitSha.getBytes(StandardCharsets.UTF_8));
  }{code}
with this one
{code:java}
  String sourceCommitId = request.getExpectedCommitSha();
  if (sourceCommitId == null || sourceCommitId.isBlank()) {
      sourceCommitId = request.getExistingContentSha();
  }
  if (sourceCommitId != null && !sourceCommitId.isBlank()) {
      multipartBuilder.addPart(FIELD_SOURCE_COMMIT_ID, 
StandardHttpContentType.TEXT_PLAIN, 
sourceCommitId.getBytes(StandardCharsets.UTF_8));
  }{code}
After the module was built and replaced, the error disappeared.

Please check it.

  was:
Good afternoon!

While configuring integration with Bitbucket (Data Center), I ran into the 
problem that when filling in all the necessary fields in versioning and 
applying the changes, I get the error "Failed to remove flow from Flow Registry 
due to Could not parse response from Bitbucket API". At the same time, I 
observe that a commit has appeared in the repository. An AI suggested making 
the following corrections to the source code: in the 
BitbucketRepositoryClient.java replace this block of code

{code:java}
  final String expectedCommitSha = request.getExpectedCommitSha();
  if (expectedCommitSha != null && !expectedCommitSha.isBlank()) {
      multipartBuilder.addPart(FIELD_SOURCE_COMMIT_ID, 
StandardHttpContentType.TEXT_PLAIN, 
expectedCommitSha.getBytes(StandardCharsets.UTF_8));
  }{code}
with this one

{code:java}
  String sourceCommitId = request.getExpectedCommitSha();
  if (sourceCommitId == null || sourceCommitId.isBlank()) {
      sourceCommitId = request.getExistingContentSha();
  }
  if (sourceCommitId != null && !sourceCommitId.isBlank()) {
      multipartBuilder.addPart(FIELD_SOURCE_COMMIT_ID, 
StandardHttpContentType.TEXT_PLAIN, 
sourceCommitId.getBytes(StandardCharsets.UTF_8));
  }{code}
After the module was built and replaced, the error disappeared.

Please check it.


> Bitbucket integration error
> ---------------------------
>
>                 Key: NIFI-15849
>                 URL: https://issues.apache.org/jira/browse/NIFI-15849
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Flow Versioning
>    Affects Versions: 2.8.0
>            Reporter: Evgeny
>            Priority: Major
>
> Good afternoon!
> While configuring integration with Bitbucket (Data Center), I ran into the 
> problem that when filling in all the necessary fields in versioning and 
> applying the changes, I get the error "{*}Failed to remove flow from Flow 
> Registry due to Could not parse response from Bitbucket API{*}". At the same 
> time, I observe that a commit has appeared in the repository. An AI suggested 
> making the following corrections to the source code: in the 
> BitbucketRepositoryClient.java replace this block of code
> {code:java}
>   final String expectedCommitSha = request.getExpectedCommitSha();
>   if (expectedCommitSha != null && !expectedCommitSha.isBlank()) {
>       multipartBuilder.addPart(FIELD_SOURCE_COMMIT_ID, 
> StandardHttpContentType.TEXT_PLAIN, 
> expectedCommitSha.getBytes(StandardCharsets.UTF_8));
>   }{code}
> with this one
> {code:java}
>   String sourceCommitId = request.getExpectedCommitSha();
>   if (sourceCommitId == null || sourceCommitId.isBlank()) {
>       sourceCommitId = request.getExistingContentSha();
>   }
>   if (sourceCommitId != null && !sourceCommitId.isBlank()) {
>       multipartBuilder.addPart(FIELD_SOURCE_COMMIT_ID, 
> StandardHttpContentType.TEXT_PLAIN, 
> sourceCommitId.getBytes(StandardCharsets.UTF_8));
>   }{code}
> After the module was built and replaced, the error disappeared.
> Please check it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to