Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into ALFREDAPI-535/merge
Browse files Browse the repository at this point in the history
  • Loading branch information
WimCrols committed Dec 12, 2023
2 parents cd78c8a + 435f0d6 commit 8d831b8
Show file tree
Hide file tree
Showing 355 changed files with 6,561 additions and 7,831 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Fixes https://xenitsupport.jira.com/browse/ALFREDAPI-<**YOUR TICKET ID**>
- [ ] Is [CHANGELOG.md](https://github.com/xenit-eu/alfred-api/blob/master/CHANGELOG.md) extended?
- [ ] Does this PR avoid breaking the API?
Breaking changes include adding, changing or removing endpoints and/or JSON objects used in requests and responses.
- [ ] Does the PR comply to REST HTTP result codes policy outlined in the [user guide](https://docs.xenit.eu/alfred-api/stable-user/rest-api/index.html#rest-http-result-codes)?
- [ ] Does the PR comply to REST HTTP result codes policy outlined in the [user guide](https://docs.xenit.eu/alfred-api/user/rest-api/index.html#rest-http-result-codes)?
- [ ] Is error handling done through a method annotated with `@ExceptionHandler` in the webscript classes?
- [ ] Does the PR follow our [coding styleguide and other active procedures](https://xenitsupport.jira.com/wiki/spaces/XEN/pages/624558081/XeniT+Enhancement+Proposals+XEP)?
- [ ] Is usage of `this.` prefix avoided?
Expand Down
30 changes: 10 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
name: 'Continuous Integration'
on:
push:
branches:
- 'master*'
- 'release*'
pull_request:
workflow_dispatch:
env:
ALFRESCO_NEXUS_USERNAME: ${{ secrets.ALFRESCO_NEXUS_USERNAME }}
ALFRESCO_NEXUS_PASSWORD: ${{ secrets.ALFRESCO_NEXUS_PASSWORD }}
CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }}
CLOUDSMITH_APIKEY: ${{ secrets.CLOUDSMITH_APIKEY }}
jobs:
BuildAndPublish:
strategy:
matrix:
alfresco_version: [ 62, 70, 71, 72, 73 ]
alfresco_version: [ 70, 71, 72, 73, 74 ]
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Check out
Expand All @@ -31,28 +26,23 @@ jobs:
registry: private.docker.xenit.eu
username: ${{ secrets.CLOUDSMITH_USER }}
password: ${{ secrets.CLOUDSMITH_APIKEY }}

- name: Build interface # Execute before integration testing to catch errors early
uses: gradle/[email protected]
with:
arguments: :apix-interface:build :apix-interface:javadoc

- name: Unit test REST API
uses: gradle/gradle-build-action@v2.3.0
uses: gradle/gradle-build-action@v2.4.2
with:
arguments: --info :apix-rest-v1:test
- name: Build and test
uses: gradle/gradle-build-action@v2.3.0
uses: gradle/gradle-build-action@v2.4.2
with:
arguments: >-
--info
:apix-impl:apix-impl-${{ matrix.alfresco_version }}:test
:apix-integrationtests:test-${{ matrix.alfresco_version }}:integrationTest
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v3
with:
name: test-result
path: /home/runner/work/**/build/reports
retention-days: 2
:apix-integrationtests:alfresco:${{ matrix.alfresco_version }}:integrationTest
- name: Publish Test Report
uses: mikepenz/[email protected]
if: success() || failure()
Expand All @@ -63,8 +53,8 @@ jobs:
detailed_summary: true

- name: Publish
if: ${{ startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/heads/release') }}
uses: gradle/gradle-build-action@v2.3.0
if: ${{ startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/heads/release') }}"
uses: gradle/gradle-build-action@v2.4.2
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
Expand All @@ -75,4 +65,4 @@ jobs:
arguments: >-
--info -PsigningKeyId=DF8285F0
:apix-interface:publish
:apix-impl:apix-impl-${{ matrix.alfresco_version }}:publish
:alfresco:${{ matrix.alfresco_version }}:publish
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Alfred API - Changelog

## 5.0.0 (2023-12-12)
From this version onward Dynamic Extensions is replaced by [Alfresco MVC](https://github.com/dgradecak/alfresco-mvc)
as framework to reduce maintenance efforts.

To make this change clearer the Alfred API Maven group ID has been updated from `eu.xenit.apix`
to `eu.xenit.alfred.api`.

This release also drops support for Alfresco 6.2 and adds support for 7.4.

### Added
* [ALFREDAPI-519](https://xenitsupport.jira.com/browse/ALFREDAPI-519): Add support for Alfresco 7.4

### Changed
* [ALFREDAPI-527](https://xenitsupport.jira.com/browse/ALFREDAPI-527):
Alfresco containers use port 8080 now instead of ephemeral ports
* [ALFREDAPI-536](https://xenitsupport.jira.com/browse/ALFREDAPI-536): Reabsorb alfred-api-docs repo into this

### Fixed
* [ALFREDAPI-520](https://xenitsupport.jira.com/browse/ALFREDAPI-520): Enforce encoding on bulk json responses to guarantee clean text
* [ALFREDAPI-531](https://xenitsupport.jira.com/browse/ALFREDAPI-531): Fix facet qname splitting for dates
* [ALFREDAPI-532](https://xenitsupport.jira.com/browse/ALFREDAPI-532): Fix :apix-interface:javadoc

### Removed
* [ALFREDAPI-504](https://xenitsupport.jira.com/browse/ALFREDAPI-504): Drop Dynamic Extensions in favor of Alfresco MVC
* [ALFREDAPI-519](https://xenitsupport.jira.com/browse/ALFREDAPI-519): Remove support for Alfresco 6.2



## 4.0.1 (2023-06-13)
This release removes swaggerui_5x from alfred-api artifact and changes generation of Snapshot qualifier to comform to maven format.
Expand All @@ -9,6 +36,7 @@ This release removes swaggerui_5x from alfred-api artifact and changes generatio
* [ALFREDAPI-513](https://xenitsupport.jira.com/browse/ALFREDAPI-513): Remove swaggerui_5x from alfred-api artifact
* [ALFREDAPI-514](https://xenitsupport.jira.com/browse/ALFREDAPI-514): Change generation of Snapshot qualifier to comform to maven format.
* [ALFREDAPI-522](https://xenitsupport.jira.com/browse/ALFREDAPI-522): Change gradle repositories from artifactory.xenit to cloudsmith && artifactory.alfresco.
* [ALFREDAPI-516](https://xenitsupport.jira.com/browse/ALFREDAPI-516): Classpath cleanup


## 4.0.0 (2023-01-17)
Expand Down
72 changes: 15 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Alfred API

[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)
[![Jenkins Build Status](https://jenkins-2.xenit.eu/buildStatus/icon?job=Xenit+Github%2Falfred-api%2Fmaster&subject=Jenkins)](https://jenkins-2.xenit.eu/job/Xenit%20Github/job/alfred-api/job/master/)
[![Maven Central](https://img.shields.io/maven-central/v/eu.xenit.apix/apix-interface.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22eu.xenit.apix%22%20AND%20a%3A%22apix-interface%22)
![CI status](https://github.com/xenit-eu/alfred-api/actions/workflows/ci.yml/badge.svg)
[![Maven Central](https://img.shields.io/maven-central/v/eu.xenit.alfred.api/apix-interface.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22eu.xenit.alfred.api%22%20AND%20a%3A%22apix-interface%22)

Alfred API abstracts away past and future changes to the Alfresco, across major and minor versions, providing a stable
interface to Alfresco on which client-side applications can be built.
Expand All @@ -19,14 +19,7 @@ are not supported by the Alfresco Public API.

## Usage
Full documentation can be found at the [project's documentation](https://docs.xenit.eu/alfred-api/stable-user/index.html).

## Installation

### Pre-requisites
Alfred API requires **_Dynamic Extensions For Alfresco_**, version 2.0.1 or later. This module should be installed first.
Acquisition and installation instructions can be found [here](https://github.com/xenit-eu/dynamic-extensions-for-alfresco).

Full documentation can be found at the [project's documentation](https://docs.xenit.eu/alfred-api/).

## Contributing

Expand All @@ -40,7 +33,7 @@ Acquisition and installation instructions can be found [here](https://github.com
* Add a note to the changelog with upgrade instructions
* Notify all customers at the next release
* When working in REST code, please comply to **REST HTTP result codes** policy outlined in the
[user guide](https://docs.xenit.eu/alfred-api/stable-user/rest-api/index.html#rest-http-result-codes).
[user guide](https://docs.xenit.eu/alfred-api/user/rest-api/index.html#rest-http-result-codes).
* Prefer unit tests over integration tests to keep builds fast
* Avoid `this.` prefix for consistency (unless the scope is ambiguous).
* Follow our [coding styleguide and other active procedures](https://xenitsupport.jira.com/wiki/spaces/XEN/pages/624558081/XeniT+Enhancement+Proposals+XEP).
Expand All @@ -49,12 +42,10 @@ Acquisition and installation instructions can be found [here](https://github.com
* *apix-interface* builds the interface of Alfred API. This part is agnostic of the
Alfresco version used.
* *apix-rest-v1* builds the REST API of Alfred API.
* *apix-impl* builds the AMP which is the main deliverable for Alfred API. The AMP contains the JARs of
*apix-interface* and *apix-rest-v1*.
* The top directory also contains code shared over different Alfresco versions.
* *apix-impl/xx* contains all code per Alfresco version. It has a *src/java* folder
for code specific to that Alfresco version and a *src/java-shared code* for the code shared between
versions. This code is automatically symlinked from the *apix-impl* directory.
* *apix-impl* builds the Java code for each version of Alfresco.
* *alfresco* builds the AMP for each Alfresco version that is the main deliverable for Alfred API. The AMP contains
the JARs of *apix-interface* and *apix-rest-v1*.
* *alfresco/xx* contains the correct properties for each Alfresco version.
* *apix-integrationtests* contains the integration tests for each Alfresco version.

### How to
Expand All @@ -70,61 +61,28 @@ Where `VERSION` is e.g. `70`.

#### Run integration tests
```bash
./gradlew :apix-integrationtests:test-${VERSION}:integrationTest
./gradlew :apix-integrationtests:alfresco:${VERSION}:integrationTest
```
Again, where `VERSION` is e.g. `70`.

However, this starts (and afterwards stops) docker containers. This includes starting an Alfresco container,
adding a startup time of several minutes. To circumvent this you also run the test on already running containers with
for example:
```bash
./gradlew -x composeUp -x composeDown :apix-integrationtests:test-61:integrationTest -Pprotocol=http -Phost=localhost -Pport=8061
./gradlew -x composeUp -x composeDown :apix-integrationtests:alfresco:74:integrationTest -Pprotocol=http -Phost=localhost -Pport=8074
```

If you only want to run specific tests, you can specify this on the Gradle invocation with a pattern. For example:
```bash
./gradlew :apix-integrationtests:alfresco:74:integrationTest -x composeDown --tests C*ServiceTest
```

#### Run integration tests under debugger
1. Debugging settings are already added by `apix-docker/${VERSION}/debug-extension.docker-compose.yml`, including a
portmapping `8000:8000`. This file does not get loaded when running in Jenkins.
portmapping `8000:8000`. This file does not get loaded when running in CI.
2. Prepare your remote debugger in IntelliJ and set breakpoints where you want in your tests
(or Alfred API code).
3. Run the integration tests (see section above).
4. Wait until the container is started and healthy, then attach the debugger.

Again, where `VERSION` is e.g. `70`.

#### Deploy code changes for development
In a development scenario, it is possible to upload code changes to a running alfresco through dynamic extensions.
This requires the running alfresco to already have an older or equal version of alfred-api installed, and
the use of the jar artifact instead of the amp to do the new install.
The JAR has the format `apix-impl-{ALFRESCO-VERSION}-{APIX-VERSION}.jar` and can be found under
`apix-impl/{ALFRESCO-VERSION}/build/libs/`, where `ALFRESCO-VERSION` is one of *(62|70|71|72|73)*.
The new installation can be done either through the DE web interface, or with the following gradle task.
```bash
./gradlew :apix-impl:apix-impl-{ALFRESCO-VERSION}:installBundle -Phost={ALFRESCO-HOST} -Pport={ALFRESCO-PORT}
```
Where `VERSION` is e.g. `70` and here `PORT` is the port mapping of the *alfresco-core* container e.g. `32774`.

*Protip:* If you get tired of changing the port after every `docker-compose up`, you can temporarily put a
fixed port in the *docker-compose.yml* of the version you are working with. (The rationale behind using
variable ephemeral ports is that during parallel builds on Jenkins port clashes must be avoided.)

For example for version 7.0, change in *apix-docker/70/docker-compose.yml*
the ports line from:
```yaml
services:
alfresco-core:
ports:
- ${DOCKER_IP}:8080
```
to:
```yaml
services:
alfresco-core:
ports:
- ${DOCKER_IP}:9070:8080
```
and then restart the containers with:
```bash
./gradlew :apix-docker:docker-70:composeUp --info
```
28 changes: 0 additions & 28 deletions _idea_runConfigurations/Integration_Tests_50.xml

This file was deleted.

21 changes: 0 additions & 21 deletions _idea_runConfigurations/Integration_tests_51__JUnit_.xml

This file was deleted.

20 changes: 0 additions & 20 deletions _idea_runConfigurations/Integration_tests_51__JUnit___1_.xml

This file was deleted.

5 changes: 5 additions & 0 deletions alfresco/70/overrides.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ext {
alfresco_version = "7.0.0"
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
alfresco_max_version = alfresco_version.substring(0, 3) + ".99"
}
5 changes: 5 additions & 0 deletions alfresco/71/overrides.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ext {
alfresco_version = "7.1.1"
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
alfresco_max_version = alfresco_version.substring(0, 3) + ".99"
}
5 changes: 5 additions & 0 deletions alfresco/72/overrides.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ext {
alfresco_version = "7.2.1"
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
alfresco_max_version = alfresco_version.substring(0, 3) + ".99"
}
7 changes: 7 additions & 0 deletions alfresco/73/overrides.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description = "Xenit Alfred API implementation Alfresco 7.3"

ext {
alfresco_version = '7.3.1'
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
alfresco_max_version = alfresco_version.substring(0, 3) + ".99"
}
8 changes: 8 additions & 0 deletions alfresco/74/overrides.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description = "Xenit Alfred API implementation Alfresco 7.4"

ext {
alfresco_version = '7.4.0'
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
//Not setting alfresco_max_version here to make it easier to test on next Alfresco version (only for latest version)
alfresco_max_version = null // explicit null to overwrite properties from other projects
}
Loading

0 comments on commit 8d831b8

Please sign in to comment.