diff --git a/.github/release-notes.yml b/.github/release-notes.yml deleted file mode 100644 index 74535a000fd..00000000000 --- a/.github/release-notes.yml +++ /dev/null @@ -1,20 +0,0 @@ -releasenotes: - sections: - - title: "Headliners" - emoji: ":star:" - labels: [ "headliner" ] - - title: "New Features" - emoji: ":gift:" - labels: [ "feature" ] - - title: "Enhancements" - emoji: ":sparkles:" - labels: [ "enhancement" ] - - title: "Bugs Fixed" - emoji: ":beetle:" - labels: [ "bug" ] - - title: "Documentation" - emoji: ":book:" - labels: "documentation" - - title: "Automation" - emoji: ":robot:" - labels: [ "automation" ] diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000000..d30df62ae17 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,23 @@ +changelog: + categories: + - title: Headliners + labels: + - headliner + - title: New Features + labels: + - feature + - title: Enhancements + labels: + - enhancement + - title: Bugs Fixed + labels: + - bug + - title: Documentation + labels: + - documentation + - title: Automation + labels: + - automation + - title: Other changes + labels: + - "*" diff --git a/.github/workflows/create-hotfix-branch.yaml b/.github/workflows/create-hotfix-branch.yaml index 86508eb261f..cfcc4c4c981 100644 --- a/.github/workflows/create-hotfix-branch.yaml +++ b/.github/workflows/create-hotfix-branch.yaml @@ -53,7 +53,7 @@ jobs: - name: Update versions run: | - mvn versions:set -DnewVersion=$RELEASE_VERSION -DgenerateBackupPoms=false + mvn versions:set-property -Dproperty=revision -DnewVersion=${RELEASE_VERSION} -DgenerateBackupPoms=false sed -i'' -e "s/^gaffer.version=.*/gaffer.version=$RELEASE_VERSION/" rest-api/common-rest/src/main/resources/version.properties - name: Push to hotfix branch diff --git a/.github/workflows/create-release-branch.yaml b/.github/workflows/create-release-branch.yaml index e4ae794d1f8..1c2d361ac09 100644 --- a/.github/workflows/create-release-branch.yaml +++ b/.github/workflows/create-release-branch.yaml @@ -1,11 +1,9 @@ name: Create Release Branch on: - workflow_dispatch: - inputs: - version: - description: 'Release Branch Version' - required: false + milestone: + types: + - closed env: artifactId: gaffer2 @@ -23,28 +21,11 @@ jobs: token: ${{ secrets.ADMIN_GITHUB_TOKEN }} fetch-depth: 0 - - name: Set version from input - if: ${{ github.event.inputs.version }} - run: echo "RELEASE_VERSION=$(echo ${{ github.event.inputs.version }} | sed 's/^v//')" >> $GITHUB_ENV - - - name: Get latest tag - if: ${{ !github.event.inputs.version }} - uses: actions-ecosystem/action-get-latest-tag@v1 - id: get-latest-tag - - - name: Format latest tag - if: ${{ !github.event.inputs.version }} - run: echo "CURRENT_VERSION=$(echo ${{ steps.get-latest-tag.outputs.tag }} | sed 's/^gaffer2-//')" >> $GITHUB_ENV - - - name: Bump latest tag variable version - if: ${{ !github.event.inputs.version }} - run: echo "RELEASE_VERSION=$(echo ${{ env.CURRENT_VERSION }} | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/echo \1.$((\2+1)).0/' | sh)" >> $GITHUB_ENV - - - name: Verify version regex - run: echo ${{ env.RELEASE_VERSION }} | grep -E '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' + - name: Set version from milestone + run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }})" >> $GITHUB_ENV - name: Set release branch - run: echo "BRANCH_NAME=$(echo release/${{ env.RELEASE_VERSION }} )" >> $GITHUB_ENV + run: echo "BRANCH_NAME=$(echo release/"${{ env.RELEASE_VERSION }}" )" >> $GITHUB_ENV - name: Set up Github credentials run: | @@ -53,11 +34,21 @@ jobs: - name: Update versions run: | - mvn versions:set -DnewVersion=$RELEASE_VERSION -DgenerateBackupPoms=false - sed -i'' -e "s/^gaffer.version=.*/gaffer.version=$RELEASE_VERSION/" rest-api/common-rest/src/main/resources/version.properties + mvn versions:set-property -Dproperty=revision -DnewVersion=${RELEASE_VERSION} -DgenerateBackupPoms=false - name: Push to release branch run: | git checkout -b $BRANCH_NAME git commit -a -m "prepare release $artifactId-$RELEASE_VERSION" git push --set-upstream origin $BRANCH_NAME + + - name: Tag release branch + run: | + git tag gaffer2-$RELEASE_VERSION + git push origin --tags + + - name: Create PR to master + run: | + gh pr create -B master -H $BRANCH_NAME --title 'Merge release into master branch' --body 'Created by GH Action' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f5a731f1850..70d464b9882 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,21 +1,22 @@ name: Full Release on: - milestone: - types: - - closed + pull_request: + branches: + - master + types: [closed] env: artifactId: gaffer2 MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 - jobs: - create-release-tag: + deploy-release: + if: ${{ github.event.pull_request.merged }} runs-on: ubuntu-latest outputs: - branch_name: ${{ steps.branch.outputs.branch_name }} + release_version: ${{ steps.release-version.outputs.release_version }} steps: - name: Setup JDK @@ -36,103 +37,15 @@ jobs: git config user.name github-actions[bot] git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - name: Set release version - run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV - - - name: Set branch name - run: echo "BRANCH_NAME=$(git branch -a | grep $RELEASE_VERSION | tail -n 1 | cut -c 18-)" >> $GITHUB_ENV - - - name: Output branch name - id: branch - run: echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT - - - name: Fail if branch output missing (no branch found) - if: ${{ !steps.branch.outputs.branch_name }} - run: exit 1 - - - name: Merge release into master - run: | - git checkout ${{ env.BRANCH_NAME }} - git checkout master - git merge ${{ env.BRANCH_NAME }} - - - name: Push changes - run: | - git tag $artifactId-$RELEASE_VERSION - git push origin $artifactId-$RELEASE_VERSION - git push - - update-develop: - runs-on: ubuntu-latest - needs: - - create-release-tag - - steps: - - name: Checkout develop - uses: actions/checkout@v4 - with: - ref: develop - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - fetch-depth: 0 - - - name: Set up Github credentials - run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - - name: Setup JDK - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: '8' - - - name: Merge release into develop - run: | - git checkout ${{ needs.create-release-tag.outputs.branch_name }} - git checkout develop - git merge ${{ needs.create-release-tag.outputs.branch_name }} --strategy-option theirs - - - name: Update develop branch + - name: Output release version + id: release-version run: | - git checkout develop - mvn release:update-versions -B - NEW_GAFFER_VERSION=$(mvn -q help:evaluate -DforceStdout -Dexpression=pom.version) - sed -i'' -e "s/^gaffer.version=.*/gaffer.version=$NEW_GAFFER_VERSION/" rest-api/common-rest/src/main/resources/version.properties - git commit -a -m "prepare for next development iteration" - git push - - update-github-releases: - runs-on: ubuntu-latest - needs: - - create-release-tag - - steps: - - name: Checkout Master - uses: actions/checkout@v4 - with: - ref: master - - - name: Create Release Notes - uses: docker://decathlon/release-notes-generator-action:3.1.5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set version - run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV - - - name: Upload notes - uses: softprops/action-gh-release@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.artifactId }}-${{ env.RELEASE_VERSION }} - name: Gaffer ${{ env.RELEASE_VERSION }} - body_path: release_file.md + echo "release_version=$(mvn -q help:evaluate -DforceStdout -Dexpression=pom.version)" >> $GITHUB_OUTPUT generate-javadoc: runs-on: ubuntu-latest needs: - - create-release-tag + - deploy-release steps: - name: Checkout Master @@ -153,7 +66,7 @@ jobs: java-version: '11' - name: Set version - run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV + run: echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV - name: Upload Javadoc run: | @@ -173,7 +86,7 @@ jobs: release-to-nexus: runs-on: ubuntu-latest needs: - - create-release-tag + - deploy-release steps: - name: Setup JDK @@ -181,12 +94,12 @@ jobs: with: distribution: 'zulu' java-version: '8' - + - name: Checkout release uses: actions/checkout@v4 with: - ref: ${{ needs.create-release-tag.outputs.branch_name }} - + ref: master + - name: Decode CodeSigning key env: CODE_SIGNING_KEY: ${{ secrets.CODE_SIGNING_KEY }} @@ -202,4 +115,65 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} OSS_NEXUS_USERNAME: ${{ secrets.OSS_NEXUS_USERNAME }} OSS_NEXUS_PASSWORD: ${{ secrets.OSS_NEXUS_PASSWORD }} - run: mvn deploy -P quick,ossrh-release --settings cd/mvnsettings.xml -B + run: + mvn deploy -P quick,ossrh-release --settings cd/mvnsettings.xml -B + + update-github-releases: + runs-on: ubuntu-latest + needs: + - deploy-release + + steps: + - name: Checkout Master + uses: actions/checkout@v4 + with: + ref: master + + - name: Set version + run: echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV + + - name: Create github release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.artifactId }}-${{ env.RELEASE_VERSION }} + name: Gaffer ${{ env.RELEASE_VERSION }} + + update-develop: + runs-on: ubuntu-latest + needs: + - deploy-release + + steps: + - name: Checkout develop + uses: actions/checkout@v4 + with: + ref: develop + token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Set up Github credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '8' + + - name: Merge master into develop + run: | + git merge origin/master + + - name: Update develop branch + run: | + git checkout develop + mvn versions:set-property -Dproperty=revision -DnewVersion=$(echo ${{ needs.deploy-release.outputs.release_version }})-SNAPSHOT + mvn build-helper:parse-version versions:set-property \ + -Dproperty=revision \ + -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT + git commit -a -m "prepare for next development iteration" + git push diff --git a/.gitignore b/.gitignore index c0de98738b0..2e22cd36844 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Copyright 2016 Crown Copyright +# Copyright 2016-2024 Crown Copyright # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,4 +29,5 @@ parquet_data/ **/.vscode example/real-federated-store/*.properties example/real-federated-store/*.json -example/real-federated-store/*.jar \ No newline at end of file +example/real-federated-store/*.jar +.flattened-pom.xml diff --git a/core/access/pom.xml b/core/access/pom.xml index 0f71727dcc0..e37e6b359fc 100644 --- a/core/access/pom.xml +++ b/core/access/pom.xml @@ -1,6 +1,6 @@ - 1.0.0 !GafferPopGraphStructureStandardTest,!GafferPopFeatureTest,!GafferPopGraphProcessStandardTest @@ -108,7 +105,7 @@ test-jar test - + uk.gov.gchq.gaffer federated-store ${project.parent.version} @@ -156,6 +153,18 @@ + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + diff --git a/library/tinkerpop/src/main/java/uk/gov/gchq/gaffer/tinkerpop/GafferPopGraph.java b/library/tinkerpop/src/main/java/uk/gov/gchq/gaffer/tinkerpop/GafferPopGraph.java index 7d74e533709..89d4af3397d 100755 --- a/library/tinkerpop/src/main/java/uk/gov/gchq/gaffer/tinkerpop/GafferPopGraph.java +++ b/library/tinkerpop/src/main/java/uk/gov/gchq/gaffer/tinkerpop/GafferPopGraph.java @@ -57,7 +57,7 @@ import uk.gov.gchq.gaffer.tinkerpop.generator.GafferPopElementGenerator; import uk.gov.gchq.gaffer.tinkerpop.process.traversal.strategy.optimisation.GafferPopGraphStepStrategy; import uk.gov.gchq.gaffer.tinkerpop.process.traversal.strategy.optimisation.GafferPopHasStepStrategy; -import uk.gov.gchq.gaffer.tinkerpop.process.traversal.util.TypeSubTypeValueFactory; +import uk.gov.gchq.gaffer.tinkerpop.process.traversal.util.GafferCustomTypeFactory; import uk.gov.gchq.gaffer.tinkerpop.service.GafferPopNamedOperationServiceFactory; import uk.gov.gchq.gaffer.user.User; import uk.gov.gchq.koryphe.iterable.MappedIterable; @@ -215,6 +215,12 @@ public enum HasStepFilterStage { */ public static final String NOT_READ_ONLY_ELEMENTS = "gaffer.elements.notreadonly"; + /** + * Key for use in the store properties to allow setting the file location of + * the GafferPop properties file from a store properties file. + */ + public static final String GAFFERPOP_PROPERTIES = "gaffer.gafferpop.properties"; + /** * The vertex label for vertex IDs. These are {@link GafferPopVertex}s that * don't have any properties, just an ID value and a label of 'id'. @@ -249,7 +255,7 @@ public enum DefaultIdManager { private static final Logger LOGGER = LoggerFactory.getLogger(GafferPopGraph.class); private static final String GET_ALL_DEBUG_MSG = "Requested a GetAllElements, results will be truncated to: {}."; - private static final Pattern EDGE_ID_REGEX = Pattern.compile("^\\[\\s*(?[a-zA-Z0-9|-]*)\\s*(,\\s*(?