From 0da7195c976c664c3346a7404816ba062e96297b Mon Sep 17 00:00:00 2001 From: aarshi <aarshi.arora@atlan.com> Date: Tue, 10 Dec 2024 19:23:52 +0530 Subject: [PATCH 1/3] add policy variables --- .../store/graph/v2/EntityGraphRetriever.java | 11 ++++++----- .../atlas/repository/util/AccessControlUtils.java | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java index 09ec1c3eb2..e9ee72fcfe 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java @@ -1081,7 +1081,12 @@ private boolean isPolicyAttribute(Set<String> attributes) { AccessControlUtils.ATTR_POLICY_RESOURCES_CATEGORY, AccessControlUtils.ATTR_POLICY_SERVICE_NAME, AccessControlUtils.ATTR_POLICY_PRIORITY, - AccessControlUtils.REL_ATTR_POLICIES)); + AccessControlUtils.REL_ATTR_POLICIES, + AccessControlUtils.ATTR_SERVICE_SERVICE_TYPE, + AccessControlUtils.ATTR_SERVICE_TAG_SERVICE, + AccessControlUtils.ATTR_SERVICE_IS_ENABLED, + AccessControlUtils.ATTR_SERVICE_LAST_SYNC) + ); return exclusionSet.stream().anyMatch(attributes::contains); } @@ -1926,11 +1931,7 @@ public Object getVertexAttributePreFetchCache(AtlasVertex vertex, AtlasAttribute // value is present as marker, fetch the value from the vertex if (ATLAS_INDEXSEARCH_ENABLE_FETCHING_NON_PRIMITIVE_ATTRIBUTES.getBoolean()) { - //AtlasPerfMetrics.MetricRecorder nonPrimitiveAttributes = RequestContext.get().startMetricRecord("processNonPrimitiveAttributes"); return mapVertexToAttribute(vertex, attribute, null, false); - //LOG.debug("capturing excluded property set category and value, mapVertexValue - {}: {} : {} : {}", attribute.getName(), attribute.getAttributeType().getTypeCategory(), properties.get(attribute.getName()), mappedVertex); - //RequestContext.get().endMetricRecord(nonPrimitiveAttributes); - //return mappedVertex; } return null; diff --git a/repository/src/main/java/org/apache/atlas/repository/util/AccessControlUtils.java b/repository/src/main/java/org/apache/atlas/repository/util/AccessControlUtils.java index 7101868e30..1f89e4d65c 100644 --- a/repository/src/main/java/org/apache/atlas/repository/util/AccessControlUtils.java +++ b/repository/src/main/java/org/apache/atlas/repository/util/AccessControlUtils.java @@ -61,6 +61,10 @@ public final class AccessControlUtils { public static final String ATTR_PURPOSE_CLASSIFICATIONS = "purposeClassifications"; + public static final String ATTR_SERVICE_SERVICE_TYPE = "authServiceType"; + public static final String ATTR_SERVICE_TAG_SERVICE = "tagService"; + public static final String ATTR_SERVICE_IS_ENABLED = "authServiceIsEnabled"; + public static final String ATTR_SERVICE_LAST_SYNC = "authServicePolicyLastSync"; public static final String ATTR_POLICY_TYPE = "policyType"; public static final String ATTR_POLICY_USERS = "policyUsers"; public static final String ATTR_POLICY_GROUPS = "policyGroups"; From 759c2302f694ae1e3725cacd8743444d896b9225 Mon Sep 17 00:00:00 2001 From: aarshi <aarshi.arora@atlan.com> Date: Tue, 10 Dec 2024 20:03:55 +0530 Subject: [PATCH 2/3] fix pipeline --- .github/workflows/maven.yml | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f8a09b5589..b8481ac283 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,3 +1,4 @@ + # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file @@ -26,6 +27,7 @@ on: - development - master - lineageondemand + - janus0.6 jobs: build: @@ -34,12 +36,12 @@ jobs: steps: - uses: actions/checkout@v2 - + - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - + - name: Cache Maven packages uses: actions/cache@v2 with: @@ -48,8 +50,9 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Get branch name - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: get_branch + run: | + echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + echo BRANCH_NAME=${GITHUB_REF#refs/heads/} - name: Create Maven Settings uses: s4u/maven-settings-action@v2.8.0 @@ -63,7 +66,7 @@ jobs: - name: Build with Maven run: | - branch_name=${{ steps.get_branch.outputs.branch }} + branch_name=${{ env.BRANCH_NAME }} if [[ $branch_name == 'main' || $branch_name == 'master' || $branch_name == 'lineageondemand' ]] then echo "build without dashboard" @@ -73,19 +76,26 @@ jobs: chmod +x ./build.sh && ./build.sh fi - - run: echo "REPOSITORY_NAME=`echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//"`" >> $GITHUB_ENV + - name: Get Repository Name + run: echo "REPOSITORY_NAME=`echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//"`" >> $GITHUB_ENV shell: bash - name: Get version tag - run: echo "##[set-output name=version;]$(echo `git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git ${{ steps.get_branch.outputs.branch }} | awk '{ print $1}' | cut -c1-7`)abcd" - id: get_version + # run: echo "##[set-output name=version;]$(echo `git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git ${{ env.BRANCH_NAME }} | awk '{ print $1}' | cut -c1-7`)abcd" + run: | + echo "VERSION=$(git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git ${{ env.BRANCH_NAME }} | awk '{ print $1}' | cut -c1-7 | head -n 1)abcd" + echo "VERSION=$(git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git ${{ env.BRANCH_NAME }} | awk '{ print $1}' | cut -c1-7 | tr -d '[:space:]')abcd" + echo "VERSION=$(git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git ${{ env.BRANCH_NAME }} | awk '{ print $1}' | cut -c1-7 | tr -d '[:space:]')abcd" >> $GITHUB_ENV + + - name: Get commit ID + run: echo "COMMIT_ID=$(echo ${GITHUB_SHA} | cut -c1-7)abcd" >> $GITHUB_ENV - - name: Set up Buildx + - name: Set up Buildx id: buildx uses: docker/setup-buildx-action@v1 - name: Login to GitHub Registry - uses: docker/login-action@v1 + uses: docker/login-action@v1 with: registry: ghcr.io username: $GITHUB_ACTOR @@ -102,8 +112,8 @@ jobs: provenance: true push: true tags: | - ghcr.io/atlanhq/${{ github.event.repository.name }}-${{ steps.get_branch.outputs.branch }}:latest - ghcr.io/atlanhq/${{ github.event.repository.name }}-${{ steps.get_branch.outputs.branch }}:${{ steps.get_version.outputs.version }} + ghcr.io/atlanhq/${{ github.event.repository.name }}-${{ env.BRANCH_NAME }}:latest + ghcr.io/atlanhq/${{ github.event.repository.name }}-${{ env.BRANCH_NAME }}:${{ env.COMMIT_ID }} - name: Scan Image uses: aquasecurity/trivy-action@master @@ -116,4 +126,4 @@ jobs: - name: Upload Trivy scan results to GitHub Security tab uses: github/codeql-action/upload-sarif@v2.1.33 with: - sarif_file: 'trivy-image-results.sarif' + sarif_file: 'trivy-image-results.sarif' \ No newline at end of file From f2de42dafe54c7fd945445d347a03e6da4176103 Mon Sep 17 00:00:00 2001 From: aarshi <aarshi.arora@atlan.com> Date: Tue, 10 Dec 2024 21:00:43 +0530 Subject: [PATCH 3/3] remove log line --- .../atlas/repository/store/graph/v2/EntityGraphRetriever.java | 1 - 1 file changed, 1 deletion(-) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java index e9ee72fcfe..59125c492c 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java @@ -1043,7 +1043,6 @@ private Map<String, Object> preloadProperties(AtlasVertex entityVertex, AtlasEnt if (typeCategory == TypeCategory.ARRAY && elementTypeCategory == TypeCategory.PRIMITIVE) { updateAttrValue(propertiesMap, property); } else if (attribute == null && isMultiValuedProperty) { - LOG.warn("Multiple value found for key {} for entity vertex: {}", property.key(), entityVertex); updateAttrValue(propertiesMap, property); } else if (propertiesMap.get(property.key()) == null) { propertiesMap.put(property.key(), property.value());