Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kedro Viz Static Website hosting on Azure #1708

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
66f177d
CLI command kedro viz build added
jitu5 Jan 4, 2024
cc7c144
Lint fix
jitu5 Jan 4, 2024
a389a83
lint fix
jitu5 Jan 4, 2024
6528d36
Lint fix
jitu5 Jan 4, 2024
5a9f2e1
add mypy ignore
jitu5 Jan 4, 2024
b86b578
Missing build file added
jitu5 Jan 8, 2024
40003f8
Lint error fix
jitu5 Jan 8, 2024
0c879a8
BaseDeployer class added
jitu5 Jan 9, 2024
5145ba4
Unused code removed
jitu5 Jan 9, 2024
26f6275
Fix lint issue
jitu5 Jan 10, 2024
52827c2
azure deploy initial draft
ravi-kumar-pilla Jan 10, 2024
c7ed79c
added base_deployer
rashidakanchwala Jan 10, 2024
11ac321
latest
rashidakanchwala Jan 10, 2024
42af3af
add deployer factory
rashidakanchwala Jan 11, 2024
aff36ec
partial working draft
ravi-kumar-pilla Jan 12, 2024
7ad0905
Test and comments of deployers updated
jitu5 Jan 12, 2024
0ff98a2
test draft
ravi-kumar-pilla Jan 15, 2024
2a4e00f
fix lint
ravi-kumar-pilla Jan 15, 2024
ecb6a05
remove circular dependency
ravi-kumar-pilla Jan 15, 2024
39418aa
merge build
ravi-kumar-pilla Jan 15, 2024
b18d547
merge main and modify azure deployer
ravi-kumar-pilla Jan 17, 2024
8b504fb
fix lint
ravi-kumar-pilla Jan 17, 2024
9d683aa
revert back consent
ravi-kumar-pilla Jan 17, 2024
2655d1a
minor updates
ravi-kumar-pilla Jan 18, 2024
2ac04fd
update pytests
ravi-kumar-pilla Jan 19, 2024
c258ec1
add pytest for azure shareableviz
ravi-kumar-pilla Jan 19, 2024
44241ca
refactor and add timeout
ravi-kumar-pilla Jan 22, 2024
40df81e
merge main
ravi-kumar-pilla Jan 23, 2024
c9e2436
refactor cli
ravi-kumar-pilla Jan 23, 2024
9c31fc4
update pytest
ravi-kumar-pilla Jan 23, 2024
e05630b
add release note
ravi-kumar-pilla Jan 23, 2024
e1016e2
fix flaky test
ravi-kumar-pilla Jan 23, 2024
2868fa3
fix PR comments and flaky test
ravi-kumar-pilla Jan 24, 2024
c934570
testing flaky c
ravi-kumar-pilla Jan 24, 2024
6572ce0
remove flaky test
ravi-kumar-pilla Jan 24, 2024
3758a53
merge main
ravi-kumar-pilla Jan 24, 2024
09e1c4c
resolve conflicts
ravi-kumar-pilla Jan 24, 2024
3b34d8a
fix PR comments
ravi-kumar-pilla Jan 25, 2024
9b9478a
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into fe…
ravi-kumar-pilla Feb 6, 2024
bce7258
merge extended support
ravi-kumar-pilla Feb 8, 2024
c27f419
add back cypress flaky test
ravi-kumar-pilla Feb 8, 2024
496c2c4
remove cypress flaky test
ravi-kumar-pilla Feb 8, 2024
bb2e6a9
remove duplicate pytest parameter
ravi-kumar-pilla Feb 8, 2024
cd05c91
remove fsspec upper bound
ravi-kumar-pilla Feb 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix PR comments and flaky test
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
  • Loading branch information
ravi-kumar-pilla committed Jan 24, 2024
commit 2868fa39ac17d6eab4d8d56d304dde184ac9a1b7
4 changes: 2 additions & 2 deletions cypress/tests/ui/flowchart/shareable-urls.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('Shareable URLs', () => {
.should('be.enabled');
});

it('verifies that error message appears with wrong inputs on publish button click #TC-59', () => {
it('verifies that error message appears with wrong inputs on publish button click #TC-59', { defaultCommandTimeout: 12000 } , () => {
const bucketName = 'myBucketName';
const primaryButtonNodeText = 'Publish';
const errorButtonNodeText = 'Go back';
Expand All @@ -135,7 +135,7 @@ describe('Shareable URLs', () => {
cy.get('.shareable-url-modal .modal__wrapper').contains(
'Something went wrong. Please try again later.'
);
cy.get('[data-test=btnGoBack]').contains(errorButtonNodeText);
cy.get('.shareable-url-modal__error button').contains(errorButtonNodeText);
});

it('verifies that AWS link is generated with correct inputs on publish button click #TC-60', () => {
Expand Down
8 changes: 3 additions & 5 deletions package/kedro_viz/api/rest/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import packaging
from fastapi.encoders import jsonable_encoder
from fastapi.responses import JSONResponse, ORJSONResponse
from kedro.io.core import get_protocol_and_path
from pydantic import BaseModel

from kedro_viz.api.rest.utils import get_package_version
Expand Down Expand Up @@ -444,20 +443,19 @@ def save_api_pipeline_response_to_fs(pipelines_path: str, remote_fs: Any):
raise exc


def save_api_responses_to_fs(api_dir: str, remote_fs: Any):
def save_api_responses_to_fs(path: str, remote_fs: Any):
"""Saves all Kedro Viz API responses to a directory."""
try:
protocol, path = get_protocol_and_path(api_dir)
logger.debug(
"""Saving/Uploading api files to %s""",
api_dir,
path,
)

main_path = f"{path}/api/main"
nodes_path = f"{path}/api/nodes"
pipelines_path = f"{path}/api/pipelines"

if protocol == "file":
if "file" in remote_fs.protocol:
remote_fs.makedirs(path, exist_ok=True)
remote_fs.makedirs(nodes_path, exist_ok=True)
remote_fs.makedirs(pipelines_path, exist_ok=True)
Expand Down
26 changes: 11 additions & 15 deletions package/tests/test_api/test_rest/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,14 +972,14 @@ def test_save_api_pipeline_response_to_fs(self, mocker):
mock_write_api_response_to_fs.assert_has_calls(expected_calls, any_order=True)

@pytest.mark.parametrize(
"file_path, protocol, path",
"file_path, protocol",
[
("s3://shareableviz", "s3", "shareableviz"),
("abfs://shareableviz", "abfs", "shareableviz"),
("shareableviz", "file", "shareableviz"),
("s3://shareableviz", "s3"),
("abfs://shareableviz", "abfs"),
("shareableviz", "file"),
],
)
def test_save_api_responses_to_fs(self, file_path, protocol, path, mocker):
def test_save_api_responses_to_fs(self, file_path, protocol, mocker):
mock_api_main_response_to_fs = mocker.patch(
"kedro_viz.api.rest.responses.save_api_main_response_to_fs"
)
Expand All @@ -989,22 +989,18 @@ def test_save_api_responses_to_fs(self, file_path, protocol, path, mocker):
mock_api_pipeline_response_to_fs = mocker.patch(
"kedro_viz.api.rest.responses.save_api_pipeline_response_to_fs"
)
mock_get_protocol_and_path = mocker.patch(
"kedro_viz.api.rest.responses.get_protocol_and_path",
return_value=(protocol, path),
)

mockremote_fs = mocker.MagicMock()
mock_filesystem = mocker.patch("fsspec.filesystem")
mock_filesystem.return_value.protocol = protocol

save_api_responses_to_fs(file_path, mockremote_fs)
save_api_responses_to_fs(file_path, mock_filesystem.return_value)

mock_get_protocol_and_path.assert_called_once_with(file_path)
mock_api_main_response_to_fs.assert_called_once_with(
f"{path}/api/main", mockremote_fs
f"{file_path}/api/main", mock_filesystem.return_value
)
mock_api_node_response_to_fs.assert_called_once_with(
f"{path}/api/nodes", mockremote_fs
f"{file_path}/api/nodes", mock_filesystem.return_value
)
mock_api_pipeline_response_to_fs.assert_called_once_with(
f"{path}/api/pipelines", mockremote_fs
f"{file_path}/api/pipelines", mock_filesystem.return_value
)
1 change: 0 additions & 1 deletion src/components/shareable-url-modal/shareable-url-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ const ShareableUrlModal = ({ onToggleModal, visible }) => {
<div className="shareable-url-modal__error">
<p>Error message: {responseError}</p>
<Button
dataTest="btnGoBack"
mode="primary"
onClick={() => {
setDeploymentState('default');
Expand Down