Skip to content

Commit

Permalink
Launchdarkly Integration (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-armah authored Mar 31, 2024
1 parent 9eeb823 commit c65f249
Show file tree
Hide file tree
Showing 18 changed files with 2,283 additions and 0 deletions.
153 changes: 153 additions & 0 deletions integrations/launchdarkly/.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/launchdarkly/.port/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
157 changes: 157 additions & 0 deletions integrations/launchdarkly/.port/resources/blueprints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
[
{
"identifier": "launchDarklyProject",
"description": "This blueprint represents a project in LaunchDarkly.",
"title": "LaunchDarkly Project",
"icon": "Launchdarkly",
"schema": {
"properties": {
"tags": {
"type": "array",
"title": "Tags",
"description": "Tags associated with the project for organizational purposes."
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
},
{
"identifier": "launchDarklyFeatureFlag",
"description": "This blueprint represents a feature flag in LaunchDarkly.",
"title": "LaunchDarkly Feature Flag",
"icon": "Launchdarkly",
"schema": {
"properties": {
"kind": {
"type": "string",
"title": "Flag Kind",
"description": "The type of the feature flag (e.g., boolean)."
},
"description": {
"type": "string",
"title": "Description",
"description": "A description of what the flag controls."
},
"creationDate": {
"type": "string",
"format": "date-time",
"title": "Creation Date",
"description": "The date and time when the flag was created."
},
"clientSideAvailability": {
"type": "object",
"title": "Client-Side Availability",
"description": "Availability of the flag for client-side applications."
},
"temporary": {
"type": "boolean",
"title": "Temporary Flag",
"description": "Indicates if the flag is temporary."
},
"tags": {
"type": "array",
"title": "Tags",
"description": "Tags associated with the feature flag."
},
"maintainer": {
"type": "string",
"title": "Maintainer",
"description": "Email address of the maintainer of the flag."
},
"customProperties": {
"type": "object",
"title": "Custom Properties",
"description": "Custom properties associated with the flag."
},
"archived": {
"type": "boolean",
"title": "Archived",
"description": "Indicates if the flag is archived."
},
"deprecated": {
"type": "boolean",
"title": "Deprecated",
"description": "Indicates if the flag is deprecated."
},
"variations": {
"type": "array",
"title": "Variations",
"description": "An array of possible variations for the flag"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"environments": {
"title": "Environments",
"target": "launchDarklyEnvironment",
"required": false,
"many": true
}
}
},
{
"identifier": "launchDarklyEnvironment",
"description": "This blueprint represents an environment in LaunchDarkly",
"title": "LaunchDarkly Environment",
"icon": "Launchdarkly",
"schema": {
"properties": {
"defaultTtl": {
"type": "number",
"title": "Default TTL",
"description": "The default time-to-live (in minutes) for feature flag settings in this environment."
},
"secureMode": {
"type": "boolean",
"title": "Secure Mode",
"description": "Indicates whether Secure Mode is enabled for the environment, enhancing security by verifying user tokens."
},
"defaultTrackEvents": {
"type": "boolean",
"title": "Default Track Events",
"description": "Indicates whether event tracking is enabled by default for all flags in this environment."
},
"requireComments": {
"type": "boolean",
"title": "Require Comments",
"description": "Indicates whether comments are required for changes made in this environment."
},
"confirmChanges": {
"type": "boolean",
"title": "Confirm Changes",
"description": "Indicates whether changes need to be confirmed before being applied in this environment."
},
"tags": {
"type": "array",
"title": "Tags",
"description": "A list of tags associated with the environment for organizational purposes."
},
"critical": {
"type": "boolean",
"title": "Critical Environment",
"description": "Indicates whether this environment is considered critical, which may affect change management and notifications."
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"project": {
"title": "Project",
"target": "launchDarklyProject",
"required": true,
"many": false
}
}
}
]
57 changes: 57 additions & 0 deletions integrations/launchdarkly/.port/resources/port-app-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: project
selector:
query: "true"
port:
entity:
mappings:
identifier: .key
title: .name
blueprint: '"launchDarklyProject"'
properties:
tags: .tags
- kind: flag
selector:
query: "true"
port:
entity:
mappings:
identifier: .key
title: .name
blueprint: '"launchDarklyFeatureFlag"'
properties:
kind: .kind
description: .description
creationDate: .creationDate / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ")
includeInSnippet: .includeInSnippet
clientSideAvailability: .clientSideAvailability
temporary: .temporary
tags: .tags
maintainer: ._maintainer.email
deprecated: .deprecated
variations: .variations
customProperties: .customProperties
archived: .archived
relations:
environments: .environments
- kind: environment
selector:
query: "true"
port:
entity:
mappings:
identifier: .key
title: .name
blueprint: '"launchDarklyEnvironment"'
properties:
defaultTtl: .defaultTtl
secureMode: .secureMode
defaultTrackEvents: .defaultTrackEvents
requireComments: .requireComments
confirmChanges: .confirmChanges
tags: .tags
critical: .critical
relations:
project: .__projectKey
24 changes: 24 additions & 0 deletions integrations/launchdarkly/.port/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
type: launchdarkly
description: launchdarkly integration for Port Ocean
docs: https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/launchdarkly
icon: Launchdarkly
features:
- type: exporter
section: Project management
resources:
- kind: project
- kind: flag
- kind: auditlog
- kind: environment
configurations:
- name: launchdarklyToken
required: true
sensitive: true
type: string
- name: launchdarklyHost
required: false
type: string
default: https://app.launchdarkly.com
- name: appHost
type: url
required: false
Loading

0 comments on commit c65f249

Please sign in to comment.