Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 8 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.33</version>
<version>4.36</version>
<relativePath />
</parent>

Expand All @@ -31,7 +31,7 @@
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/config-file-provider-plugin</gitHubRepo>
<maven.javadoc.skip>true</maven.javadoc.skip>
<jenkins.version>2.303.3</jenkins.version>
<jenkins.version>2.324</jenkins.version>
<java.level>8</java.level>
<hpi.compatibleSinceVersion>2.15</hpi.compatibleSinceVersion>
</properties>
Expand Down Expand Up @@ -67,7 +67,12 @@
<groupId>org.jenkins-ci</groupId>
<artifactId>symbol-annotation</artifactId>
<version>1.23</version>
</dependency>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.10.0</version>
</dependency>
Comment on lines +71 to +75
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was excluded for script-security do we need to version manage this or should it be excluded if coming from core via guava?

</dependencies>
</dependencyManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void regularCaseStillWorking() throws Exception {
assertThat(store.getConfigs(), hasSize(1));

HtmlPage configFiles = wc.goTo("configfiles");
HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@onclick, 'removeConfig?id=" + CONFIG_ID + "')]");
HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@data-url, 'removeConfig?id=" + CONFIG_ID + "')]");
Copy link
Member

@jtnord jtnord Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@data-url, 'removeConfig?id=" + CONFIG_ID + "')|contains(@onclick, 'removeConfig?id=" + CONFIG_ID + "')]");

should (if I got my XPath correct) have allowed to fix a PCT issue without bumping the core to a non LTS making upgrades for LTS users harder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically, your saying to make this test backwards compatible with older jenkins?

Copy link
Member

@jtnord jtnord Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am saying you could have done that to make it backwards compatible with older Jenkins versions. As it is a test only issue and the plugin will work after an upgrade of Jenkins, the current way is not making it any harder for users (there would be no broken plugins post upgrade) so it is fine as is. (hence my approval)


AtomicReference<Boolean> confirmCalled = new AtomicReference<>(false);
wc.setConfirmHandler((page, s) -> {
Expand Down Expand Up @@ -87,7 +87,7 @@ public void xssPrevention() throws Exception {
JenkinsRule.WebClient wc = j.createWebClient();

HtmlPage configFiles = wc.goTo("configfiles");
HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@onclick, 'removeConfig?id=" + CONFIG_ID + "')]");
HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@data-url, 'removeConfig?id=" + CONFIG_ID + "')]");

AtomicReference<Boolean> confirmCalled = new AtomicReference<>(false);
AtomicReference<Boolean> alertCalled = new AtomicReference<>(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public void xssPreventionInFolder() throws Exception {
// Clicking the button works
// If we click on the link, it goes via POST, therefore it removes it successfully
HtmlPage configFiles = wc.goTo(f1.getUrl() + "configfiles");
HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@onclick, 'removeConfig?id=" + CONFIG_ID + "')]");
HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@data-url, 'removeConfig?id=" + CONFIG_ID + "')]");

AtomicReference<Boolean> confirmCalled = new AtomicReference<>(false);
wc.setConfirmHandler((page, s) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void xssPrevention() throws Exception {
// Clicking the button works
// If we click on the link, it goes via POST, therefore it removes it successfully
HtmlPage configFiles = wc.goTo("configfiles");
HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@onclick, 'removeConfig?id=" + CONFIG_ID + "')]");
HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@data-url, 'removeConfig?id=" + CONFIG_ID + "')]");

AtomicReference<Boolean> confirmCalled = new AtomicReference<>(false);
wc.setConfirmHandler((page, s) -> {
Expand Down