Skip to content

feat: add empty array integrations field to the manifest upon write-manifest #698

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions rsconnect/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
Sequence,
Union,
cast,
Any,
)

# Even though TypedDict is available in Python 3.8, because it's used with NotRequired,
Expand Down Expand Up @@ -123,6 +124,15 @@ class ManifestDataPythonPackageManager(TypedDict):
package_file: str


class ManifestIntegrationRequests(TypedDict):
guid: NotRequired[str]
name: NotRequired[str]
description: NotRequired[str]
auth_type: NotRequired[str]
integration_type: NotRequired[str]
config: NotRequired[dict[str, Any]]


class ManifestData(TypedDict):
version: int
files: dict[str, ManifestDataFile]
Expand All @@ -132,6 +142,7 @@ class ManifestData(TypedDict):
quarto: NotRequired[ManifestDataQuarto]
python: NotRequired[ManifestDataPython]
environment: NotRequired[ManifestDataEnvironment]
integration_requests: NotRequired[list[ManifestIntegrationRequests]]


class Manifest:
Expand Down Expand Up @@ -397,6 +408,7 @@ def make_source_manifest(
env_management_py=env_management_py,
env_management_r=env_management_r,
)
manifest.data["integration_requests"] = []
return manifest.data


Expand Down Expand Up @@ -1659,6 +1671,7 @@ def write_notebook_manifest_json(
manifest_data = make_source_manifest(
app_mode, environment, file_name, None, image, env_management_py, env_management_r
)

if hide_all_input or hide_tagged_input:
if "jupyter" not in manifest_data:
manifest_data["jupyter"] = {}
Expand Down Expand Up @@ -1761,6 +1774,7 @@ def create_voila_manifest(
env_management_py=env_management_py,
env_management_r=env_management_r,
)
manifest.data["integration_requests"] = []
manifest.deploy_dir = deploy_dir
if entrypoint and isfile(entrypoint):
validate_file_is_notebook(entrypoint)
Expand Down Expand Up @@ -1825,6 +1839,7 @@ def write_voila_manifest_json(
manifest_flattened_copy_data = manifest.get_flattened_copy().data
if multi_notebook and "metadata" in manifest_flattened_copy_data:
manifest_flattened_copy_data["metadata"]["entrypoint"] = ""

manifest_path = join(deploy_dir, "manifest.json")
write_manifest_json(manifest_path, manifest_flattened_copy_data)
return exists(manifest_path)
Expand Down Expand Up @@ -1915,6 +1930,7 @@ def write_api_manifest_json(
manifest, _ = make_api_manifest(
directory, entry_point, app_mode, environment, extra_files, excludes, image, env_management_py, env_management_r
)

manifest_path = join(directory, "manifest.json")

write_manifest_json(manifest_path, manifest)
Expand Down Expand Up @@ -2029,6 +2045,7 @@ def write_tensorflow_manifest_json(
excludes,
image,
)

manifest_path = join(directory, "manifest.json")
write_manifest_json(manifest_path, manifest)

Expand Down
Loading
Loading