Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: Static analysis
run: docker compose run --rm app composer phpstan

- name: Run tests
run: docker compose run --rm app composer tests

- name: Push
if: startsWith(github.ref, 'refs/tags/')
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ composer.phar
/.env
/projects.csv
*.env.json
/.phpunit.result.cache
/phpunit.xml
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,41 @@ Behavior:
- With `--force`, unlinks each shared and linked bucket and confirms the action.
- Prints a summary of unlinked or would-be-unlinked buckets.

### Migrate data-apps orchestrator/flow tasks to data-app-control
Migrate orchestration/flow tasks that start a data app via the legacy `keboola.data-apps` component so they use
`keboola.data-app-control` instead (see [AJDA-2445](https://linear.app/keboola/issue/AJDA-2445)). Skips tasks whose
`keboola.data-apps` parameters look unlike the "start app" shape used in practice (e.g. `create`/`delete`/`terminate`),
so those are never silently mistransformed. Safe to re-run: already-migrated tasks are skipped.

```
php cli.php manage:migrate-data-apps-orchestrator-tasks [-f|--force] <token> <url> <projects>
```
Arguments:
- `token` (required): Manage API token.
- `url` (required): Stack URL, including `https://`.
- `projects` (required): Comma-separated project IDs (e.g. `1,7,146`), or `all` to run on every project on the stack.

Options:
- `--force` / `-f`: Actually perform the migration. Without this flag, the command only reports what would change (dry-run).

Behavior:
- For each target project, creates a temporary Storage API token via the Manage API and lists all configurations of
both `keboola.orchestrator` (legacy orchestrations) and `keboola.flow` (next-gen conditional flows) - these are two
separate components on stacks with conditional flows enabled, not variants of the same one.
- Scans each configuration's tasks for ones pointing at `keboola.data-apps` (both inline `configData` and `configId`
references to a saved `keboola.data-apps` configuration).
- Rewrites matching tasks to `keboola.data-app-control` with `parameters.appId` set from the resolved app ID
(`configId` references are flattened into inline `configData` rather than creating a new saved configuration).
- Tasks that reference a `keboola.data-apps` config that couldn't be resolved (missing/inaccessible `configId`
reference, or a malformed/non-scalar app id) are reported separately from deliberately-skipped, expected task
shapes (e.g. `create`/`delete`/`terminate`) - the former needs manual follow-up, the latter doesn't.
- With `--force`, updates the configuration via the Storage API with a `changeDescription`. Without it, only reports
what would be migrated.
- Running with `<projects>` set to `all` together with `--force` asks for interactive confirmation first, as a
safety net against an accidental stack-wide mutation.
- Prints a summary: projects checked/disabled/errored, configurations scanned/touched, tasks migrated/skipped
(unsupported vs. unresolvable).

### Mass enablement of dynamic backends for multiple projects
Prerequisities: https://keboola.atlassian.net/wiki/spaces/KB/pages/2135982081/Enable+Dynamic+Backends#Enable-for-project

Expand Down
2 changes: 2 additions & 0 deletions cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Keboola\Console\Command\MassDeleteProjectWorkspaces;
use Keboola\Console\Command\MassProjectEnableDynamicBackends;
use Keboola\Console\Command\MassProjectExtendExpiration;
use Keboola\Console\Command\MigrateDataAppsOrchestratorTasks;
use Keboola\Console\Command\OrganizationIntoMaintenanceMode;
use Keboola\Console\Command\OrganizationResetWorkspacePasswords;
use Keboola\Console\Command\OrganizationsAddFeature;
Expand All @@ -43,6 +44,7 @@
$application->add(new SetDataRetention());
$application->add(new MassProjectExtendExpiration());
$application->add(new MassProjectEnableDynamicBackends());
$application->add(new MigrateDataAppsOrchestratorTasks());
$application->add(new AddFeature());
$application->add(new AllStacksIterator());
$application->add(new LineageEventsExport());
Expand Down
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
},
"require-dev": {
"squizlabs/php_codesniffer": "3.*",
"phpstan/phpstan": "^2.0"
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^11.0"
},
"authors": [
{
Expand All @@ -29,9 +30,15 @@
"Keboola\\Console": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Keboola\\Console\\Tests\\": "tests/"
}
},
"scripts": {
"phpstan": "phpstan analyse --memory-limit=512M",
"phpcs": "phpcs --standard=PSR2 -n src/",
"phpcbf": "phpcbf --standard=PSR2 -n src/"
"phpcbf": "phpcbf --standard=PSR2 -n src/",
"tests": "phpunit"
}
}
Loading