Skip to content

Commit

Permalink
Update to package and new migrate command
Browse files Browse the repository at this point in the history
-   APP-4439 - [PACKAGE] Changed appId creation logic to used UUID4 instead of UUID5 for App Builder
-   APP-4440 - [MIGRATE] Added new command to assist in migration of TcEx 3 Apps to TcEx 4
  • Loading branch information
bsummers-tc authored Apr 10, 2024
1 parent b714a1c commit 5fb6c55
Show file tree
Hide file tree
Showing 17 changed files with 491 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The TcEx CLI package provides functionality for creating ThreatConnect Apps and

* arrow (https://pypi.python.org/pypi/arrow)
* black (https://pypi.org/project/black/)
* inflect (https://pypi.python.org/pypi/inflect)
* inflection (https://pypi.python.org/pypi/inflection)
* isort (https://pypi.org/project/isort/)
* paho-mqtt (https://pypi.org/project/paho-mqtt/)
* pyaes (https://pypi.org/project/pyaes/)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = [
"arrow",
"black",
"debugpy",
"inflect",
"inflection",
"isort",
"paho-mqtt<2.0.0",
"pyaes",
Expand Down
4 changes: 3 additions & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## 1.0.3

- APP-4397 [CONFIG] Update to make runtimeVariable feature a default feature only for playbook apps.
- APP-4397 - [PACKAGE] Updated feature generation logic to make runtimeVariable on be added for Playbook Apps
- APP-4439 - [PACKAGE] Changed appId creation logic to used UUID4 instead of UUID5 for App Builder
- APP-4440 - [MIGRATE] Added new command to assist in migration of TcEx 3 Apps to TcEx 4

## 1.0.2

Expand Down
2 changes: 1 addition & 1 deletion tcex_cli/app/config
2 changes: 2 additions & 0 deletions tcex_cli/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# first-party
from tcex_cli.cli.deploy import deploy
from tcex_cli.cli.deps import deps
from tcex_cli.cli.migrate import migrate
from tcex_cli.cli.package import package
from tcex_cli.cli.run import run
from tcex_cli.cli.spec_tool import spec_tool
Expand Down Expand Up @@ -93,6 +94,7 @@ def version_callback(
app.command('deps')(deps.command)
app.command('init')(init.command)
app.command('list')(list_.command)
app.command('migrate')(migrate.command)
app.command('package')(package.command)
app.command('run')(run.command)
app.command('spec-tool')(spec_tool.command)
Expand Down
1 change: 1 addition & 0 deletions tcex_cli/cli/migrate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""TcEx Framework Module"""
34 changes: 34 additions & 0 deletions tcex_cli/cli/migrate/migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""TcEx Framework Module"""

# standard library
from typing import Optional

# third-party
import typer

# first-party
from tcex_cli.cli.migrate.migrate_cli import MigrateCli
from tcex_cli.render.render import Render

# typer does not yet support PEP 604, but pyupgrade will enforce
# PEP 604. this is a temporary workaround until support is added.
IntOrNone = Optional[int]
StrOrNone = Optional[str]


def command(
forward_ref: bool = typer.Option(
True, help='If true, show typing forward lookup reference that require updates.'
),
update_code: bool = typer.Option(True, help='If true, apply code replacements.'),
):
"""Migrate App to TcEx 4 from TcEx 2/3."""
cli = MigrateCli(
forward_ref,
update_code,
)
try:
cli.walk_code()
except Exception as ex:
cli.log.exception('Failed to run "tcex deps" command.')
Render.panel.failure(f'Exception: {ex}')
Loading

0 comments on commit 5fb6c55

Please sign in to comment.