Skip to content

Forward merge to master #357

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

Merged
merged 18 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
93be037
Issue #276: Send slack message on PR commit
madisparntopia Apr 14, 2023
588b437
Merge branch 'atlassian-labs:master' into master
madisparn Jun 9, 2023
ac24098
Merge branch 'atlassian-labs:master' into master
madisparn Jun 20, 2023
33eb488
Issue #276: Remove UI changes
madisparntopia Jun 20, 2023
ca8d6e4
Merge pull request #277 from madisparn/master
mvlasovatl Feb 2, 2024
1b115ef
[skip ci] prepare release bitbucket-slack-server-integration-plugin-4…
Feb 2, 2024
aa578db
[skip ci] prepare for next development iteration
Feb 2, 2024
f48574d
chnages regarding jquery 2 and 3 upgrade. ajax events should be attac…
adarsh-atlas Mar 14, 2024
da57e6d
Replace Jira testing license by compatible with Data Center
yhrytsai-atl Mar 29, 2024
d5875fa
Merge pull request #352 from atlassian-labs/issue/CONFSRVDEV-30257-jq…
yevhenhr Mar 29, 2024
15b4a85
[skip ci] prepare release confluence-slack-server-integration-plugin-…
Mar 29, 2024
3953351
[skip ci] prepare for next development iteration
Mar 29, 2024
9696aa4
Replaced deprecated 'restoreDataFromResource' func. with another one …
Certifiedmi Apr 11, 2024
8b90649
Merge pull request #353 from atlassian-labs/replace-jira-test-license
yevhenhr Apr 15, 2024
fd89357
Bump org.springframework:spring-context from 5.3.18 to 5.3.19
dependabot[bot] Feb 2, 2024
c3eb9f4
Revert "Bump org.springframework:spring-context from 5.3.18 to 5.3.19"
yevhenhr Apr 16, 2024
749192a
Merge pull request #361 from atlassian-labs/revert-360-master
yevhenhr Apr 16, 2024
be7d25e
Merge pull request #362 from atlassian-labs/master
yevhenhr Apr 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bitbucket-slack-server-integration-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.atlassian.bitbucket.plugins</groupId>
<artifactId>bitbucket-slack-server-integration-plugin</artifactId>
<packaging>atlassian-plugin</packaging>
<version>4.0.9-SNAPSHOT</version>
<version>4.0.10-SNAPSHOT</version>

<name>Slack for Bitbucket Data Center</name>
<description>This is the Slack integration for Bitbucket Data Center</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.atlassian.bitbucket.plugins.slack.notification;

import static com.atlassian.bitbucket.plugins.slack.notification.PullRequestNotificationTypes.RESCOPED;

import lombok.experimental.UtilityClass;

import java.util.Collections;
Expand All @@ -12,7 +14,9 @@
public class NotificationUtil {
public static Set<String> ALL_NOTIFICATION_TYPE_KEYS = Collections.unmodifiableSet(Stream
.of(
Stream.of(PullRequestNotificationTypes.values()).map(PullRequestNotificationTypes::getKey),
Stream.of(PullRequestNotificationTypes.values())
.filter(type -> RESCOPED != type)
.map(PullRequestNotificationTypes::getKey),
Stream.of(RepositoryNotificationTypes.values()).map(RepositoryNotificationTypes::getKey),
Stream.of(TaskNotificationTypes.values()).map(TaskNotificationTypes::getKey)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.atlassian.bitbucket.event.pull.PullRequestParticipantReviewedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestParticipantUnapprovedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestReopenedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestRescopedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestReviewersUpdatedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestUpdatedEvent;
import com.atlassian.sal.api.message.I18nResolver;
Expand All @@ -26,6 +27,7 @@
public enum PullRequestNotificationTypes {
OPENED("PRCreated"),
UPDATED("PRParticipantUpdated"),
RESCOPED("PRReScoped"),
DECLINED("PRDeclined"),
REOPENED("PRReopened"),
MERGED("PRMerged"),
Expand All @@ -45,6 +47,7 @@ public enum PullRequestNotificationTypes {
ImmutableMap.<Class<? extends PullRequestEvent>, PullRequestNotificationTypes>builder()
.put(PullRequestOpenedEvent.class, PullRequestNotificationTypes.OPENED)
.put(PullRequestUpdatedEvent.class, PullRequestNotificationTypes.UPDATED)
.put(PullRequestRescopedEvent.class, PullRequestNotificationTypes.RESCOPED)
.put(PullRequestDeclinedEvent.class, PullRequestNotificationTypes.DECLINED)
.put(PullRequestReopenedEvent.class, PullRequestNotificationTypes.REOPENED)
.put(PullRequestMergedEvent.class, PullRequestNotificationTypes.MERGED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ slack.activity.pr.reviewed.short=:warning: {0} *reviewed* pull request {1} in {2
slack.activity.pr.unapproved.needswork.short={0} *removed needs work review* from pull request {1} in {2}
slack.activity.pr.merged.short=:tada: {0} *merged* pull request {1} in {2}
slack.activity.pr.updated.short={0} *updated* pull request {1} in {2}
slack.activity.pr.rescoped.short={0} *re-scoped* pull request {1} in {2}
slack.activity.pr.comment.added.short=:speech_balloon: {0} *commented* on pull request {1} in {2}
slack.activity.pr.comment.deleted.short=:speech_balloon: {0} *deleted a comment* on pull request {1} in {2}
slack.activity.pr.comment.edited.short=:speech_balloon: {0} *edited a comment* on pull request {1} in {2}
Expand All @@ -249,6 +250,7 @@ slack.activity.pr.reviewed.long=:warning: {0} *reviewed* pull request {1} {3} \u
slack.activity.pr.unapproved.needswork.long={0} *removed needs work review* from pull request {1} {3} \u2192 {4} in {2}
slack.activity.pr.merged.long=:tada: {0} *merged* pull request {1} {3} \u2192 {4} in {2}
slack.activity.pr.updated.long={0} *updated* pull request {1} {3} \u2192 {4} in {2}
slack.activity.pr.rescoped.long={0} *re-scoped* pull request {1} {3} \u2192 {4} in {2}
slack.activity.pr.comment.added.long=:speech_balloon: {0} *commented* on pull request {1} {3} \u2192 {4} in {2}
slack.activity.pr.comment.deleted.long=:speech_balloon: {0} *deleted a comment* on pull request {1} {3} \u2192 {4} in {2}
slack.activity.pr.comment.edited.long=:speech_balloon: {0} *edited a comment* on pull request {1} {3} \u2192 {4} in {2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.atlassian.bitbucket.event.pull.PullRequestParticipantReviewedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestParticipantUnapprovedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestReopenedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestRescopedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestReviewersUpdatedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestUpdatedEvent;
import com.atlassian.bitbucket.event.repository.RepositoryForkedEvent;
Expand Down Expand Up @@ -90,6 +91,8 @@ class BitbucketNotificationEventListenerTest {
@Mock
private PullRequestUpdatedEvent pullRequestUpdatedEvent;
@Mock
private PullRequestRescopedEvent pullRequestRescopedEvent;
@Mock
private PullRequestDeclinedEvent pullRequestDeclinedEvent;
@Mock
private PullRequestReopenedEvent pullRequestReopenedEvent;
Expand Down Expand Up @@ -267,6 +270,11 @@ void onEvent_pullRequestUpdatedEvent_shouldCallExpectedMethods() {
testPullRequestEvent(pullRequestUpdatedEvent, PullRequestNotificationTypes.UPDATED);
}

@Test
void onEvent_pullRequestRescopedEvent_shouldCallExpectedMethods() {
testPullRequestEvent(pullRequestRescopedEvent, PullRequestNotificationTypes.RESCOPED);
}

@Test
void onEvent_pullRequestDeclinedEvent_shouldCallExpectedMethods() {
testPullRequestEvent(pullRequestDeclinedEvent, PullRequestNotificationTypes.DECLINED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@ExtendWith(MockitoExtension.class)
public class DefaultNotificationConfigurationServiceTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.atlassian.bitbucket.event.pull.PullRequestParticipantReviewedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestParticipantUnapprovedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestReopenedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestRescopedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestReviewersUpdatedEvent;
import com.atlassian.bitbucket.event.pull.PullRequestUpdatedEvent;
import com.atlassian.bitbucket.event.repository.RepositoryForkedEvent;
Expand Down Expand Up @@ -142,6 +143,8 @@ public class SlackNotificationRendererTest {
@Mock
PullRequestUpdatedEvent pullRequestUpdatedEvent;
@Mock
PullRequestRescopedEvent pullRequestRescopedEvent;
@Mock
PullRequestCommentEvent pullRequestCommentEvent;
@Mock
PullRequestReviewersUpdatedEvent pullRequestReviewersUpdatedEvent;
Expand Down Expand Up @@ -479,6 +482,16 @@ void getPullRequestOpenedMessage_shouldBuildCorrectSlackMessage() {
testGenericPullRequestMessage(pullRequestOpenedEvent, PullRequestAction.OPENED);
}

@Test
void getPullRequestUpdatedMessage_shouldBuildCorrectSlackMessage() {
testGenericPullRequestMessage(pullRequestUpdatedEvent, PullRequestAction.UPDATED);
}

@Test
void getPullRequestRescopedMessage_shouldBuildCorrectSlackMessage() {
testGenericPullRequestMessage(pullRequestRescopedEvent, PullRequestAction.RESCOPED);
}

@Test
void getPullRequestApprovedMessage_shouldBuildCorrectSlackMessage() {
testGenericPullRequestMessage(pullRequestApprovedEvent, PullRequestAction.APPROVED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<artifactId>confluence-slack-server-integration-plugin</artifactId>
<packaging>atlassian-plugin</packaging>
<name>Slack for Confluence Data Center</name>
<version>3.0.5-SNAPSHOT</version>
<version>3.0.6-SNAPSHOT</version>
<description>This is the Slack integration for Confluence Data Center</description>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ require([
event.stopPropagation();
}

$(function () {
$('body').bind('ajaxComplete', handleAjaxComplete);
$(function() {
$(document).on('ajaxComplete', handleAjaxComplete);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ require([
}

$(function() {
$('body').bind('ajaxComplete', handleAjaxComplete);
$(document).on('ajaxComplete', handleAjaxComplete);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
import org.junit.Before;
import org.junit.Test;

import static com.atlassian.jira.testkit.client.util.TimeBombLicence.LICENCE_FOR_TESTING;
import static com.atlassian.plugins.slack.test.RequestMatchers.success;
import static it.com.atlassian.jira.plugins.slack.util.JiraFuncTestData.SAMPLE_DATA;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;

@SkipCacheCheck
public class SanityCheckFuncTest extends SlackFunctionalTestBase {

@Before
public void beforeEach() {
backdoor.restoreDataFromResource(SAMPLE_DATA, LICENCE_FOR_TESTING);
backdoor.restoreDataFromResource(SAMPLE_DATA);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import java.util.List;

import static com.atlassian.jira.testkit.client.util.TimeBombLicence.LICENCE_FOR_TESTING;
import static com.atlassian.plugins.slack.test.RequestMatchers.hasHit;
import static com.atlassian.plugins.slack.test.RequestMatchers.requestEntityProperty;
import static com.github.seratch.jslack.api.methods.Methods.CHAT_UNFURL;
Expand All @@ -23,7 +22,7 @@
public class UnfurlingFuncTest extends SlackFunctionalTestBase {
@Before
public void beforeEach() {
backdoor.restoreDataFromResource(SAMPLE_DATA, LICENCE_FOR_TESTING);
backdoor.restoreDataFromResource(SAMPLE_DATA);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.junit.Before;
import org.junit.Test;

import static com.atlassian.jira.testkit.client.util.TimeBombLicence.LICENCE_FOR_TESTING;
import static com.atlassian.plugins.slack.test.TestTeams.DUMMY_TEAM_ID;
import static it.com.atlassian.jira.plugins.slack.util.JiraFuncTestData.SAMPLE_DATA;
import static org.hamcrest.MatcherAssert.assertThat;
Expand All @@ -16,7 +15,7 @@
public class UserLinkFuncTest extends SlackFunctionalTestBase {
@Before
public void beforeEach() {
backdoor.restoreDataFromResource(SAMPLE_DATA, LICENCE_FOR_TESTING);
backdoor.restoreDataFromResource(SAMPLE_DATA);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.junit.Before;
import org.junit.Test;

import static com.atlassian.jira.testkit.client.util.TimeBombLicence.LICENCE_FOR_TESTING;
import static com.atlassian.plugins.slack.test.RequestMatchers.body;
import static com.atlassian.plugins.slack.test.RequestMatchers.hasHit;
import static com.atlassian.plugins.slack.test.RequestMatchers.request;
Expand All @@ -24,7 +23,7 @@
public class WorkspaceLinkFuncTest extends SlackFunctionalTestBase {
@Before
public void beforeEach() {
backdoor.restoreDataFromResource(SAMPLE_DATA, LICENCE_FOR_TESTING);
backdoor.restoreDataFromResource(SAMPLE_DATA);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.List;
import java.util.Optional;

import static com.atlassian.jira.testkit.client.util.TimeBombLicence.LICENCE_FOR_TESTING;
import static com.atlassian.plugins.slack.test.RequestMatchers.hasHit;
import static com.atlassian.plugins.slack.test.RequestMatchers.requestEntityProperty;
import static com.atlassian.plugins.slack.test.TestChannels.PUBLIC;
Expand All @@ -44,7 +43,7 @@ public class ConfigurationWebTest extends SlackWebTestBase {

@Before
public void beforeEach() {
backdoor.restoreDataFromResource(SAMPLE_DATA, LICENCE_FOR_TESTING);
backdoor.restoreDataFromResource(SAMPLE_DATA);
flakyWebTestKiller.disableJiraFlags();
connectToDummyTeamAndConfirmAdminAccount();
}
Expand Down
Loading