port-ocean 0.10.0__tar.gz → 0.10.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of port-ocean might be problematic. Click here for more details.

Files changed (139) hide show
  1. {port_ocean-0.10.0 → port_ocean-0.10.1}/PKG-INFO +1 -1
  2. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/new.py +38 -4
  3. port_ocean-0.10.1/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.env.example +2 -0
  4. port_ocean-0.10.1/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/blueprints.json +41 -0
  5. port_ocean-0.10.1/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/port-app-config.yml +16 -0
  6. port_ocean-0.10.1/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/spec.yaml +15 -0
  7. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CHANGELOG.md +1 -1
  8. port_ocean-0.10.1/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CONTRIBUTING.md +7 -0
  9. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Makefile +3 -3
  10. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/changelog/.gitignore +1 -0
  11. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/main.py +16 -1
  12. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/pyproject.toml +7 -3
  13. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/mixins/entities.py +1 -1
  14. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/config/settings.py +6 -5
  15. {port_ocean-0.10.0 → port_ocean-0.10.1}/pyproject.toml +3 -3
  16. port_ocean-0.10.0/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/spec.yaml +0 -15
  17. {port_ocean-0.10.0 → port_ocean-0.10.1}/LICENSE.md +0 -0
  18. {port_ocean-0.10.0 → port_ocean-0.10.1}/README.md +0 -0
  19. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/__init__.py +0 -0
  20. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/bootstrap.py +0 -0
  21. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/__init__.py +0 -0
  22. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cli.py +0 -0
  23. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/__init__.py +0 -0
  24. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/defaults/__init___.py +0 -0
  25. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/defaults/clean.py +0 -0
  26. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/defaults/dock.py +0 -0
  27. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/defaults/group.py +0 -0
  28. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/list_integrations.py +0 -0
  29. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/main.py +0 -0
  30. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/pull.py +0 -0
  31. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/sail.py +0 -0
  32. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/commands/version.py +0 -0
  33. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/__init__.py +0 -0
  34. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/cookiecutter.json +0 -0
  35. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/extensions.py +0 -0
  36. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/hooks/post_gen_project.py +0 -0
  37. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore +0 -0
  38. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.gitignore +0 -0
  39. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/.gitignore +0 -0
  40. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile +0 -0
  41. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/README.md +0 -0
  42. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/debug.py +0 -0
  43. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/poetry.toml +0 -0
  44. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/sonar-project.properties +0 -0
  45. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/__init__.py +0 -0
  46. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.py +0 -0
  47. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/cli/utils.py +0 -0
  48. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/__init__.py +0 -0
  49. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/__init__.py +0 -0
  50. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/authentication.py +0 -0
  51. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/client.py +0 -0
  52. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/mixins/__init__.py +0 -0
  53. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/mixins/blueprints.py +0 -0
  54. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/mixins/integrations.py +0 -0
  55. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/mixins/migrations.py +0 -0
  56. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/retry_transport.py +0 -0
  57. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/types.py +0 -0
  58. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/clients/port/utils.py +0 -0
  59. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/config/__init__.py +0 -0
  60. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/config/base.py +0 -0
  61. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/config/dynamic.py +0 -0
  62. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/consumers/__init__.py +0 -0
  63. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/consumers/kafka_consumer.py +0 -0
  64. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/context/__init__.py +0 -0
  65. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/context/event.py +0 -0
  66. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/context/ocean.py +0 -0
  67. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/context/resource.py +0 -0
  68. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/__init__.py +0 -0
  69. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/defaults/__init__.py +0 -0
  70. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/defaults/clean.py +0 -0
  71. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/defaults/common.py +0 -0
  72. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/defaults/initialize.py +0 -0
  73. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/event_listener/__init__.py +0 -0
  74. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/event_listener/base.py +0 -0
  75. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/event_listener/factory.py +0 -0
  76. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/event_listener/http.py +0 -0
  77. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/event_listener/kafka.py +0 -0
  78. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/event_listener/once.py +0 -0
  79. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/event_listener/polling.py +0 -0
  80. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/__init__.py +0 -0
  81. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/base.py +0 -0
  82. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/entities_state_applier/__init__.py +0 -0
  83. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/entities_state_applier/base.py +0 -0
  84. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/entities_state_applier/port/__init__.py +0 -0
  85. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/entities_state_applier/port/applier.py +0 -0
  86. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/entities_state_applier/port/get_related_entities.py +0 -0
  87. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py +0 -0
  88. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/entity_processor/__init__.py +0 -0
  89. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/entity_processor/base.py +0 -0
  90. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/entity_processor/jq_entity_processor.py +0 -0
  91. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/port_app_config/__init__.py +0 -0
  92. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/port_app_config/api.py +0 -0
  93. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/port_app_config/base.py +0 -0
  94. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/port_app_config/models.py +0 -0
  95. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/resync_state_updater/__init__.py +0 -0
  96. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/handlers/resync_state_updater/updater.py +0 -0
  97. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/integrations/__init__.py +0 -0
  98. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/integrations/base.py +0 -0
  99. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/integrations/mixins/__init__.py +0 -0
  100. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/integrations/mixins/events.py +0 -0
  101. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/integrations/mixins/handler.py +0 -0
  102. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/integrations/mixins/sync.py +0 -0
  103. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/integrations/mixins/sync_raw.py +0 -0
  104. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/integrations/mixins/utils.py +0 -0
  105. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/models.py +0 -0
  106. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/ocean_types.py +0 -0
  107. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/core/utils.py +0 -0
  108. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/exceptions/__init__.py +0 -0
  109. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/exceptions/api.py +0 -0
  110. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/exceptions/base.py +0 -0
  111. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/exceptions/clients.py +0 -0
  112. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/exceptions/context.py +0 -0
  113. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/exceptions/core.py +0 -0
  114. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/exceptions/port_defaults.py +0 -0
  115. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/exceptions/utils.py +0 -0
  116. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/helpers/__init__.py +0 -0
  117. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/helpers/async_client.py +0 -0
  118. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/helpers/retry.py +0 -0
  119. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/log/__init__.py +0 -0
  120. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/log/handlers.py +0 -0
  121. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/log/logger_setup.py +0 -0
  122. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/log/sensetive.py +0 -0
  123. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/middlewares.py +0 -0
  124. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/ocean.py +0 -0
  125. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/py.typed +0 -0
  126. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/run.py +0 -0
  127. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/sonar-project.properties +0 -0
  128. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/tests/__init__.py +0 -0
  129. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/tests/test_sample.py +0 -0
  130. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/utils/__init__.py +0 -0
  131. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/utils/async_http.py +0 -0
  132. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/utils/async_iterators.py +0 -0
  133. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/utils/cache.py +0 -0
  134. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/utils/misc.py +0 -0
  135. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/utils/queue_utils.py +0 -0
  136. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/utils/repeat.py +0 -0
  137. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/utils/signal.py +0 -0
  138. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/utils/time.py +0 -0
  139. {port_ocean-0.10.0 → port_ocean-0.10.1}/port_ocean/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
@@ -1,12 +1,39 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  import click
4
+ import json
4
5
  from cookiecutter.main import cookiecutter # type: ignore
6
+ import os
5
7
 
6
8
  from port_ocean.cli.commands.main import cli_start, print_logo, console
7
9
  from port_ocean.cli.utils import cli_root_path
8
10
 
9
11
 
12
+ def add_vscode_configuration(result: str, name: str) -> None:
13
+ vscode_entry_root_path = "${workspaceFolder}/integrations/" + name
14
+ new_vscode_entry = {
15
+ "console": "integratedTerminal",
16
+ "cwd": vscode_entry_root_path,
17
+ "envFile": f"{vscode_entry_root_path}/.env",
18
+ "justMyCode": True,
19
+ "name": f"Run {name} integration",
20
+ "program": f"{vscode_entry_root_path}/debug.py",
21
+ "python": f"{vscode_entry_root_path}/.venv/bin/python",
22
+ "request": "launch",
23
+ "type": "debugpy",
24
+ }
25
+
26
+ vs_code_json_path = os.path.join(os.path.dirname(result), "../.vscode/launch.json")
27
+ if not os.path.exists(vs_code_json_path):
28
+ return
29
+ vs_code_json = json.load(open(vs_code_json_path, "r"))
30
+ vs_code_json["configurations"].append(new_vscode_entry)
31
+
32
+ with open(vs_code_json_path, "w") as vs_code_json_file:
33
+ json.dump(vs_code_json, vs_code_json_file, indent=2)
34
+ vs_code_json_file.write("\n")
35
+
36
+
10
37
  @cli_start.command()
11
38
  @click.argument("path", default=".", type=click.Path(exists=True))
12
39
  @click.option(
@@ -37,6 +64,9 @@ def new(path: str, is_private_integration: bool) -> None:
37
64
  )
38
65
  name = result.split("/")[-1]
39
66
 
67
+ if not is_private_integration:
68
+ add_vscode_configuration(result, name)
69
+
40
70
  console.print(
41
71
  "\n🌊 Ahoy, Captain! Your project is ready to set sail into the vast ocean of possibilities!",
42
72
  style="bold",
@@ -47,10 +77,14 @@ def new(path: str, is_private_integration: bool) -> None:
47
77
  f"▶️ [bold][blue]cd {path}/{name} && make install && . .venv/bin/activate[/blue][/bold]\n"
48
78
  )
49
79
  console.print(
50
- "⚓️ Set sail with [blue]Ocean[/blue]: Run [bold][blue]ocean sail[/blue] <path_to_integration>[/bold] to run the project using Ocean.\n"
51
- f"▶️ [bold][blue]ocean sail {path}/{name}[/blue][/bold] \n"
80
+ f"⚓️ Copy example env file: Run [bold][blue]cp {path}/{name}.env.example {path}/{name}/.env [/blue][/bold] and set your port credentials in the created file.\n"
52
81
  )
53
82
  console.print(
54
- "⚓️ Smooth sailing with [blue]Make[/blue]: Alternatively, you can run [bold][blue]make run[/blue][/bold] to launch your project using Make. \n"
55
- f"▶️ [bold][blue]make run {path}/{name}[/blue][/bold]"
83
+ "⚓️ Set sail with [blue]Ocean[/blue]: Run [bold][blue]ocean sail[/blue] <path_to_integration>[/bold] to run the project using Ocean.\n"
84
+ f"▶️ [bold][blue]ocean sail {path}/{name}[/blue][/bold] \n"
56
85
  )
86
+ if not is_private_integration:
87
+ console.print(
88
+ "⚓️ Smooth sailing with [blue]Make[/blue]: Alternatively, you can run [bold][blue]make run[/blue][/bold] to launch your project using Make. \n"
89
+ f"▶️ [bold][blue]make run {path}/{name}[/blue][/bold]"
90
+ )
@@ -0,0 +1,2 @@
1
+ OCEAN__PORT__CLIENT_ID="<port-client-id>"
2
+ OCEAN__PORT__CLIENT_SECRET="<port-client-secret>"
@@ -0,0 +1,41 @@
1
+ [
2
+ {
3
+ "identifier": "{{ cookiecutter.integration_slug }}ExampleBlueprint",
4
+ "title": "{{ cookiecutter.integration_name }} Example",
5
+ "icon": "Blueprint",
6
+ "schema": {
7
+ "properties": {
8
+ "status": {
9
+ "type": "string",
10
+ "enum": [
11
+ "VALID",
12
+ "FAILED"
13
+ ],
14
+ "enumColors": {
15
+ "VALID": "green",
16
+ "FAILED": "red"
17
+ },
18
+ "title": "Status"
19
+ },
20
+ "text": {
21
+ "type": "string",
22
+ "title": "Text"
23
+ },
24
+ "component": {
25
+ "type": "string",
26
+ "title": "Component"
27
+ },
28
+ "service": {
29
+ "type": "string",
30
+ "title": "Service"
31
+ },
32
+ "score": {
33
+ "type": "number",
34
+ "title": "Score"
35
+ }
36
+ },
37
+ "required": []
38
+ },
39
+ "relations": {}
40
+ }
41
+ ]
@@ -0,0 +1,16 @@
1
+ resources:
2
+ - kind: {{ cookiecutter.integration_slug}}-example-kind
3
+ selector:
4
+ query: 'true'
5
+ port:
6
+ entity:
7
+ mappings:
8
+ identifier: .my_custom_id
9
+ title: '(.my_component + " @ " + .my_service)'
10
+ blueprint: '"{{ cookiecutter.integration_slug }}ExampleBlueprint"'
11
+ properties:
12
+ status: .my_enum
13
+ text: .my_custom_text
14
+ component: .my_component
15
+ service: .my_service
16
+ score: .my_special_score
@@ -0,0 +1,15 @@
1
+ description: {{cookiecutter.integration_name}} integration for Port Ocean
2
+ icon: Cookiecutter # Should be one of the available icons in Port
3
+ features:
4
+ - type: exporter
5
+ section: Under Development # Should be one of the available sections in Port
6
+ resources:
7
+ - kind: {{ cookiecutter.integration_slug }}-example-kind
8
+ # - kind: <ResourceName2>
9
+ configurations:
10
+ - name: my{{ cookiecutter.integration_slug}}Token
11
+ # required: true
12
+ type: string
13
+ sensitive: true
14
+ - name: someApplicationUrl
15
+ type: url
@@ -1,4 +1,4 @@
1
- # Changelog
1
+ # Changelog - Ocean - {{ cookiecutter.integration_slug }}
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
@@ -0,0 +1,7 @@
1
+ # Contributing to Ocean - {{ cookiecutter.integration_slug }}
2
+
3
+ ## Running locally
4
+
5
+ #### NOTE: Add your own instructions of how to run {{ cookiecutter.integration_slug }}
6
+
7
+ This could be any gotcha's such as rate limiting, how to setup credentials and so forth
@@ -55,8 +55,8 @@ lint:
55
55
  run:
56
56
  $(ACTIVATE) && ocean sail
57
57
 
58
- test: lint
59
- $(ACTIVATE) && poetry run pytest
58
+ test:
59
+ $(ACTIVATE) && poetry run pytest -n auto
60
60
 
61
61
  clean:
62
62
  @find . -name '.venv' -type d -exec rm -rf {} \;
@@ -71,4 +71,4 @@ clean:
71
71
  rm -rf htmlcov
72
72
  rm -rf .tox/
73
73
  rm -rf docs/_build
74
- rm -rf dist/
74
+ rm -rf dist/
@@ -15,6 +15,21 @@ async def on_resync(kind: str) -> list[dict[Any, Any]]:
15
15
  # return [{"some_project_key": "someProjectValue", ...}]
16
16
  # if kind == "issues":
17
17
  # return [{"some_issue_key": "someIssueValue", ...}]
18
+
19
+ # Initial stub to show complete flow, replace this with your own logic
20
+ if kind == "{{ cookiecutter.integration_slug }}-example-kind":
21
+ return [
22
+ {
23
+ "my_custom_id": f"id_{x}",
24
+ "my_custom_text": f"very long text with {x} in it",
25
+ "my_special_score": x * 32 % 3,
26
+ "my_component": f"component-{x}",
27
+ "my_service": f"service-{x %2}",
28
+ "my_enum": "VALID" if x % 2 == 0 else "FAILED",
29
+ }
30
+ for x in range(25)
31
+ ]
32
+
18
33
  return []
19
34
 
20
35
 
@@ -38,4 +53,4 @@ async def on_resync(kind: str) -> list[dict[Any, Any]]:
38
53
  async def on_start() -> None:
39
54
  # Something to do when the integration starts
40
55
  # For example create a client to query 3rd party services - GitHub, Jira, etc...
41
- print("Starting integration")
56
+ print("Starting {{ cookiecutter.integration_slug }} integration")
@@ -9,13 +9,17 @@ python = "^3.11"
9
9
  port_ocean = { version = "^{% version %}", extras = ["cli"] }
10
10
 
11
11
  [tool.poetry.group.dev.dependencies]
12
+ # Uncomment this if you want to debug the ocean core together with your integration
13
+ # port_ocean = { path = '../../', develop = true, extras = ['all'] }
12
14
  pytest = "^7.2"
15
+ pytest-xdist = "^3.6.1"
16
+ pre-commit = "^3.7.1"
17
+ requests = "^2.32.3"
13
18
  black = "^23.3.0"
14
19
  mypy = "^1.3.0"
15
20
  ruff = "^0.0.278"
16
21
  pylint = "^2.17.4"
17
22
  towncrier = "^23.6.0"
18
- pytest-xdist = "^3.6.1"
19
23
 
20
24
  [tool.towncrier]
21
25
  directory = "changelog"
@@ -54,8 +58,8 @@ underlines = [""]
54
58
  showcontent = true
55
59
 
56
60
  [build-system]
57
- requires = ["poetry>=0.12"]
58
- build-backend = "poetry.masonry.api"
61
+ requires = ["poetry-core>=1.0.0"]
62
+ build-backend = "poetry.core.masonry.api"
59
63
 
60
64
  [tool.mypy]
61
65
  exclude = [
@@ -58,7 +58,7 @@ class EntityClientMixin:
58
58
  )
59
59
  handle_status_code(response, should_raise)
60
60
  result = response.json()
61
- result_entity = Entity.parse_obj(result)
61
+ result_entity = Entity.parse_obj(result["entity"])
62
62
  # Set the results of the search relation and identifier to the entity
63
63
  entity.identifier = result_entity.identifier or entity.identifier
64
64
  entity.relations = result_entity.relations or entity.relations
@@ -1,4 +1,4 @@
1
- from typing import Any, Literal, Type
1
+ from typing import Any, Literal, Type, cast
2
2
 
3
3
  from pydantic import Extra, AnyHttpUrl, parse_obj_as, parse_raw_as
4
4
  from pydantic.class_validators import root_validator, validator
@@ -55,9 +55,8 @@ class IntegrationSettings(BaseOceanModel, extra=Extra.allow):
55
55
  integ_type = get_integration_name()
56
56
 
57
57
  values["type"] = integ_type.lower() if integ_type else None
58
- values["identifier"] = values.get(
59
- "identifier", f"my-{integ_type}-integration".lower()
60
- )
58
+ if not values.get("identifier"):
59
+ values["identifier"] = f"my-{integ_type}-integration".lower()
61
60
 
62
61
  return values
63
62
 
@@ -71,7 +70,9 @@ class IntegrationConfiguration(BaseOceanSettings, extra=Extra.allow):
71
70
  client_timeout: int = 30
72
71
  send_raw_data_examples: bool = True
73
72
  port: PortSettings
74
- event_listener: EventListenerSettingsType
73
+ event_listener: EventListenerSettingsType = Field(
74
+ default=cast(EventListenerSettingsType, {"type": "POLLING"})
75
+ )
75
76
  # If an identifier or type is not provided, it will be generated based on the integration name
76
77
  integration: IntegrationSettings = Field(
77
78
  default_factory=lambda: IntegrationSettings(type="", identifier="")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "port-ocean"
3
- version = "0.10.0"
3
+ version = "0.10.1"
4
4
  description = "Port Ocean is a CLI tool for managing your Port projects."
5
5
  readme = "README.md"
6
6
  homepage = "https://app.getport.io"
@@ -31,8 +31,8 @@ classifiers = [
31
31
  ocean = "port_ocean.cli.cli:cli_start"
32
32
 
33
33
  [build-system]
34
- requires = ["poetry-core"]
35
- build-backend = "poetry.masonry.api"
34
+ requires = ["poetry-core>=1.0.0"]
35
+ build-backend = "poetry.core.masonry.api"
36
36
 
37
37
  [tool.poetry.dependencies]
38
38
  python = "^3.11"
@@ -1,15 +0,0 @@
1
- description: {{cookiecutter.integration_name}} integration for Port Ocean
2
- icon: Cookiecutter # Should be one of the available icons in Port
3
- features:
4
- - type: exporter
5
- section: Git Providers # Should be one of the available sections in Port
6
- resources:
7
- - kind: <ResourceName1>
8
- - kind: <ResourceName2>
9
- configurations:
10
- - name: myGitToken
11
- required: true
12
- type: string
13
- sensitive: true
14
- - name: someApplicationUrl
15
- type: url
File without changes
File without changes