Skip to content

Commit

Permalink
Feature/ocean backstage integration (#1072)
Browse files Browse the repository at this point in the history
# Description

What - A backstage integration to Port.

Why - For users who want to leave side-by-side with Port and Backstage
or migrate to Port from Backstage

How - Using Backstage Entities API

## Type of change

Please leave one option from the following and delete the rest:

- [x] New Integration (non-breaking change which adds a new integration)

<h4> All tests should be run against the port production
environment(using a testing org). </h4>

### Integration testing checklist

- [x] Integration able to create all default resources from scratch
- [x] Resync able to create entities
- [x] Resync able to update entities
- [x] Resync able to detect and delete entities
- [x] Resync finishes successfully
- ~If new resource kind is added or updated in the integration, add
example raw data, mapping and expected result to the `examples` folder
in the integration directory.~
- ~If resource kind is updated, run the integration with the example
data and check if the expected result is achieved~
- ~If new resource kind is added or updated, validate that live-events
for that resource are working as expected~
- [x] Docs PR link [here](#)

### Preflight checklist

- [x] Handled rate limiting
- [x] Handled pagination
- [x] Implemented the code in async
- ~Support Multi account~

## Screenshots


![image](https://github.com/user-attachments/assets/4b07186d-374c-4dc7-9a46-2f5a67a24899)

## API Documentation

README.md
  • Loading branch information
fokolo authored Oct 15, 2024
1 parent 7a06b33 commit d642347
Show file tree
Hide file tree
Showing 23 changed files with 3,039 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@
"python": "${workspaceFolder}/integrations/test-integration/.venv/bin/python",
"request": "launch",
"type": "debugpy"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/integrations/backstage",
"envFile": "${workspaceFolder}/integrations/backstage/.env",
"justMyCode": true,
"name": "Run backstage integration",
"program": "${workspaceFolder}/integrations/backstage/debug.py",
"python": "${workspaceFolder}/integrations/backstage/.venv/bin/python",
"request": "launch",
"type": "debugpy"
}
]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ empowering engineers to effortlessly prioritize key features and streamline the
In order to install the Ocean Framework, run the following command:

```bash
pip install port-ocean[cli]
pip install "port-ocean[cli]"
```

Or

```bash
poetry add port-ocean[cli]
poetry add "port-ocean[cli]"
```

## Run Integration
Expand Down
5 changes: 5 additions & 0 deletions integrations/backstage/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
OCEAN__PORT__CLIENT_ID="<port-client-id>"
OCEAN__PORT__CLIENT_SECRET="<port-client-secret>"

OCEAN__INTEGRATION__CONFIG__BACKSTAGE_TOKEN="<backstage-token>"
OCEAN__INTEGRATION__CONFIG__BACKSTAGE_URL="<backstage-url>"
153 changes: 153 additions & 0 deletions integrations/backstage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
1 change: 1 addition & 0 deletions integrations/backstage/.port/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
Loading

0 comments on commit d642347

Please sign in to comment.