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
Expand Up @@ -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;
Expand Down
Expand Up @@ -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
Expand Down
@@ -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
Expand Down Expand Up @@ -306,7 +306,7 @@ public String targetRef() {

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

@Override
Expand Down
@@ -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
Expand Down Expand Up @@ -329,7 +329,7 @@ public String targetRef() {

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

@Override
Expand Down
@@ -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
Expand Down Expand Up @@ -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();
Expand Down
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/src/main/java/org/openjdk/skara/test/TestIssue.java
@@ -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
Expand Down Expand Up @@ -77,7 +77,7 @@ public HostUser author() {

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

@Override
Expand Down