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

912: PR title correction logic can get stuck #1050

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -172,7 +172,7 @@ private static String fetchCommand(PullRequest pr) {
static String composeConversation(PullRequest pr) {
var filteredBody = filterCommentsAndCommands(pr.body());
if (filteredBody.isEmpty()) {
filteredBody = pr.title().strip();
filteredBody = pr.title();
}

return filteredBody;
@@ -170,7 +170,7 @@ private boolean updateTitle() {

var issue = project.issue(id);
if (issue.isPresent()) {
var issueTitle = issue.get().title().strip();
var issueTitle = issue.get().title();
if (title.isEmpty()) {
// If the title is in the form of "[project-]<bugid>" only
// we add the title from JBS
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -306,7 +306,7 @@ public String targetRef() {

@Override
public String title() {
return json.get("title").asString();
return json.get("title").asString().strip();
}

@Override
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -329,7 +329,7 @@ public String targetRef() {

@Override
public String title() {
return json.get("title").asString();
return json.get("title").asString().strip();
}

@Override
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@ public interface Issue {
HostUser author();

/**
* Title of the request.
* Title of the request. The implementation should make sure it is stripped.
* @return
*/
String title();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -72,7 +72,7 @@ public HostUser author() {

@Override
public String title() {
return json.get("fields").get("summary").asString();
return json.get("fields").get("summary").asString().strip();
}

@Override
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@ public HostUser author() {

@Override
public String title() {
return data.title;
return data.title.strip();
}

@Override