Skip to content

Commit

Permalink
Merge branch 'main' into feed-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketkatkar97 authored May 11, 2024
2 parents c0ec782 + e4add9e commit f7df0d5
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 10 deletions.
16 changes: 11 additions & 5 deletions .github/actions/prepare-for-docker-build-and-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ inputs:
description: true if we are building an Ingestion image, false otherwise
required: true
default: "false"
dockerhub_username:
description: Dockerhub Username
required: true
dockerhub_token:
description: Dockerhub Token
required: true

outputs:
tags:
Expand All @@ -34,17 +40,17 @@ runs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
password: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}
username: ${{ inputs.dockerhub_username }}
password: ${{ inputs.dockerhub_token }}

- name: Install Ubuntu dependencies
if: ${{ inputs.is_ingestion == "true" }}
if: inputs.is_ingestion == true
shell: bash
run: |
sudo apt-get install -y python3-venv
- name: Install open-metadata dependencies
if: ${{ inputs.is_ingestion == "true" }}
if: inputs.is_ingestion == true
shell: bash
run: |
python3 -m venv env
Expand All @@ -57,7 +63,7 @@ runs:
id: generate-tags
shell: bash
run: |
if ${{ inputs.push_latest == "true" }}; then
if ${{ inputs.push_latest == 'true' }}; then
echo "tags=${{ inputs.image }}:${{ inputs.tag }},${{ inputs.image }}:latest" >> $GITHUB_OUTPUT
else
echo "tags=${{ inputs.image }}:${{ inputs.tag }}" >> $GITHUB_OUTPUT
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-openmetadata-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
image: openmetadata/db
tag: ${{ inputs.tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}


- name: Build and push if event is workflow_dispatch and input is checked
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-openmetadata-ingestion-base-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
tag: ${{ inputs.tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
is_ingestion: true
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}

- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-openmetadata-ingestion-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
tag: ${{ inputs.tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
is_ingestion: true
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}

- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-openmetadata-ingestion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
tag: ${{ inputs.tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
is_ingestion: true
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}

- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docker-openmetadata-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
with:
image: openmetadata/postgresql
tag: ${{ inputs.tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
push_latest: ${{ inputs.p
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}ush_latest_tag_to_release }}

- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docker-openmetadata-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ jobs:
with:
image: openmetadata/server
tag: ${{ inputs.DOCKER_RELEASE_TAG }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
push_latest: ${{ inputs.push_
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}latest_tag_to_release }}

- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,24 @@ jest.mock('../../hooks/useApplicationStore', () => {
};
});

jest.mock('../../components/common/Loader/Loader', () => {
return jest.fn().mockImplementation(() => <p>Loader</p>);
});

describe('PermissionProvider', () => {
it('Should render loader and call getLoggedInUserPermissions', async () => {
render(
<PermissionProvider>
<div data-testid="children">Children</div>
</PermissionProvider>
);

// Verify that the API methods were called
expect(getLoggedInUserPermissions).toHaveBeenCalled();

expect(screen.getByText('Loader')).toBeInTheDocument();
});

it('Should render children and call apis when current user is present', async () => {
render(
<PermissionProvider>
Expand Down Expand Up @@ -82,5 +99,8 @@ describe('PermissionProvider', () => {
expect(getEntityPermissionById).not.toHaveBeenCalled();
expect(getEntityPermissionByFqn).not.toHaveBeenCalled();
expect(getResourcePermission).not.toHaveBeenCalled();

expect(screen.queryByText('Loader')).not.toBeInTheDocument();
expect(await screen.findByTestId('children')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const PermissionProvider: FC<PermissionProviderProps> = ({ children }) => {
const { currentUser } = useApplicationStore();
const cookieStorage = new CookieStorage();
const history = useHistory();
const [loading, setLoading] = useState(false);
const [loading, setLoading] = useState(true);

const [entitiesPermission, setEntitiesPermission] =
useState<EntityPermissionMap>({} as EntityPermissionMap);
Expand All @@ -89,7 +89,6 @@ const PermissionProvider: FC<PermissionProviderProps> = ({ children }) => {
*/
const fetchLoggedInUserPermissions = useCallback(async () => {
try {
setLoading(true);
const response = await getLoggedInUserPermissions();
setPermissions(getUIPermission(response.data || []));
redirectToStoredPath();
Expand Down Expand Up @@ -173,6 +172,8 @@ const PermissionProvider: FC<PermissionProviderProps> = ({ children }) => {
*/
if (!isEmpty(currentUser)) {
fetchLoggedInUserPermissions();
} else {
setLoading(false);
}
if (isEmpty(currentUser)) {
resetPermissions();
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def update_dockerfile_arg(arg, file_path, value):
regex_sub(
file_path,
rf"(ARG\s+{arg}=).+",
rf"\1={value}",
rf'\1"{value}"',

)

Expand Down

0 comments on commit f7df0d5

Please sign in to comment.