Skip to content

Commit

Permalink
feat: support WeasyPrint Service v63.1.0 (#319)
Browse files Browse the repository at this point in the history
Refs: #300
  • Loading branch information
grigoriev authored Jan 8, 2025
1 parent 3725e4e commit a2ebcfa
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 65 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/openapi-validation.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
name: openapi-validate
on: [push]
on:
push:
workflow_dispatch:
jobs:
check-openapi-definition:
runs-on: ubuntu-latest
name: Swagger Editor Validator Remote
steps:
- name: 📄 Checkout the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: 🧪 Validate OpenAPI definition
uses: char0n/swagger-editor-validate@fe35d650e9fc674505607519d0d12ab4de5d415d # v1
uses: swaggerexpert/swagger-editor-validate@e8e51dbc8c18e87f96b082b18a6a7cbd3c44abd8 # v1.4.2
with:
definition-file: docs/openapi.json
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ All good so far.

### Upgrade from version 7.x.x to 8.0.0

In version 8.0.0 support for Polarion 2404 and older has been dropped. This extensions supports only Polarion 2410.
In version 8.0.0 support for Polarion 2404 and older has been dropped. This extension supports only Polarion 2410.
Recommended version of WeasyPrint Service is 63.1.0.

### Upgrade from version 6.x.x to 7.0.0

Expand Down
40 changes: 0 additions & 40 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -886,11 +886,6 @@
"description": "Images deleted successfully"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Deletes images in SVN linked to specified cover page within specified scope (global or certain project)",
"tags": [
"Settings"
Expand All @@ -905,11 +900,6 @@
"description": "Template names retrieved successfully"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Get list of cover page predefined template names",
"tags": [
"Settings"
Expand Down Expand Up @@ -941,11 +931,6 @@
"description": "Template persisted successfully"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Persist content of cover page predefined template",
"tags": [
"Settings"
Expand Down Expand Up @@ -991,11 +976,6 @@
"description": "Localization file downloaded successfully"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Downloads localization values by name of localization settings",
"tags": [
"Settings"
Expand Down Expand Up @@ -1040,11 +1020,6 @@
"description": "Localization file uploaded successfully"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Uploads localization values",
"tags": [
"Settings"
Expand Down Expand Up @@ -1082,11 +1057,6 @@
"description": "Successfully retrieved the list of style package names"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Get list of style packages suitable for a document",
"tags": [
"Settings"
Expand All @@ -1110,11 +1080,6 @@
"description": "Successfully retrieved the list of style package names with the weight information"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Get full list of available style packages for the specific scope with the weight information",
"tags": [
"Settings"
Expand Down Expand Up @@ -1144,11 +1109,6 @@
"description": "default response"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Update weight information for the provided style packages",
"tags": [
"Settings"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import net.sf.okapi.lib.xliff2.reader.XLIFFReader;
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
Expand Down Expand Up @@ -46,7 +45,6 @@
@Hidden
@Path("/internal")
@Tag(name = "Settings", description = "Operations related to PDF-exporter settings management")
@SecurityRequirement(name = "bearerAuth")
public class SettingsInternalController {

private final PdfExporterPolarionService pdfExporterPolarionService = new PdfExporterPolarionService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,13 @@ private boolean sameDocument(@Nullable String projectId, @NotNull String spaceId
.toList();

for (IModule module : modules) {
String[] locationParts = module.getModuleLocation().getLocationPath().split("/");
if (locationParts.length == 2) {
result.add(new DocumentCollectionEntry(
module.getProjectId(),
locationParts[0],
locationParts[1],
module.getRevision()
));
}
DocumentCollectionEntry documentCollectionEntry = new DocumentCollectionEntry(
module.getProjectId(),
module.getModuleFolder(),
module.getModuleName(),
module.getRevision()
);
result.add(documentCollectionEntry);
}

return result;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/versions.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
weasyprint-service.version=62.4.6
weasyprint-service.version=63.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.polarion.platform.IPlatformService;
import com.polarion.platform.security.ISecurityService;
import com.polarion.platform.service.repository.IRepositoryService;
import com.polarion.subterra.base.location.ILocation;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.MockedConstruction;
Expand Down Expand Up @@ -248,18 +247,16 @@ void testGetDocumentsFromCollection() {
IModule mockModule1 = mock(IModule.class);
IModule mockModule2 = mock(IModule.class);

ILocation mockLocation1 = mock(ILocation.class);
ILocation mockLocation2 = mock(ILocation.class);

when(mockModule1.getModuleLocation()).thenReturn(mockLocation1);
when(mockModule1.getProjectId()).thenReturn(projectId);
when(mockModule1.getModuleFolder()).thenReturn("space 1");
when(mockModule1.getModuleName()).thenReturn("test Module1");
when(mockModule1.getRevision()).thenReturn("1");

when(mockModule2.getModuleLocation()).thenReturn(mockLocation2);
when(mockModule2.getProjectId()).thenReturn(projectId);
when(mockModule2.getModuleFolder()).thenReturn("_default");
when(mockModule2.getModuleName()).thenReturn("test Module2");
when(mockModule2.getRevision()).thenReturn("2");

when(mockLocation1.getLocationPath()).thenReturn("space 1/test Module1");
when(mockLocation2.getLocationPath()).thenReturn("_default/test Module2");

IBaselineCollectionElement mockElement1 = mock(IBaselineCollectionElement.class);
IBaselineCollectionElement mockElement2 = mock(IBaselineCollectionElement.class);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/test/resources/weasyprint/png/testConverterSimple_page_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/test/resources/weasyprint/png/testConverterWiki_page_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a2ebcfa

Please sign in to comment.