Skip to content

Commit

Permalink
Add Input Prompting (#43)
Browse files Browse the repository at this point in the history
* feat: add prompting for rulesets and input dir

* doc: add autocomplete instructions

* doc: add or adjust help text on commands and error msgs

* doc: various doc updates

* fix: typo

* fix: get resolved version of path, when prompting

* chore: version bump

* doc: standardize cli docs

* doc: update + alpha-sort translations

* doc: update + alpha-sort translations
  • Loading branch information
fritz-astronomer authored Jan 15, 2025
1 parent 41b5f45 commit 04763f8
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 67 deletions.
16 changes: 16 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,19 @@ You can alter the verbosity of the CLI by setting the `LOG_LEVEL` environment va
```shell
export LOG_LEVEL=DEBUG
```


## Autocomplete

Auto-completion is available for the CLI. To enable it, run the following command or place it in `.bashrc` or `.zshrc`:

### Bash
```shell
eval "$(_ORBITER_COMPLETE=bash_source orbiter)"
```


### ZSH
```shell
eval "$(_ORBITER_COMPLETE=zsh_source orbiter)"
```
29 changes: 11 additions & 18 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,25 @@ are available for download on the [Releases](https://github.com/astronomer/orbit
Utilize the [`orbiter` CLI](./cli.md) with existing translations to convert workflows
from other systems to an Airflow project.

1. Set up a new folder, and create a `workflow/` folder. Add your workflows files to it
1. **Set up a new `workflow/` folder. Add your workflows files to it**
```shell
.
└── workflow/
├── workflow_a.json
├── workflow_b.json
└── ...
```
2. Determine the specific translation ruleset via:
2. Determine the specific translation ruleset and repository via:
1. the [Origins](./origins.md) documentation
2. the [`orbiter list-rulesets`](./cli.md#list-rulesets) command
3. or [by creating a translation ruleset](#authoring-rulesets-customization), if one does not exist
3. Install the translation ruleset via the [`orbiter install`](./cli.md#install) command (substituting `<REPOSITORY>` with the value in the last step)
```shell
orbiter install --repo=<REPOSITORY>
```
4. Use the [`orbiter translate`](./cli.md#translate) command with the `<RULESET>` determined in the last step
This will produce output to an `output/` folder:
```shell
orbiter translate workflow/ --ruleset <RULESET> output/
```
5. Review the contents of the `output/` folder. If extensions or customizations are required, review
[how to extend a translation ruleset](#extend-or-customize)
6. (optional) Utilize the [`astro` CLI](https://www.astronomer.io/docs/astro/cli/overview)
to run Airflow instance with your migrated workloads
7. (optional) Deploy to [Astro](https://www.astronomer.io/try-astro/) to run your translated workflows in production! 🚀
3. **Install the translation ruleset** via the [`orbiter install`](./cli.md#install) command
4. **Translate workloads** via the [`orbiter translate`](./cli.md#translate) command
5. **Review** the contents of the output folder (default: `output/`).
If extensions or customizations are required, review [how to extend a translation ruleset](#extend-or-customize)
6. (optional) **Initialize** a full Airflow project
containing your migrated workloads with the [`astro` CLI](https://www.astronomer.io/docs/astro/cli/overview)
7. (optional) **Deploy** to [Astro](https://www.astronomer.io/try-astro/) to run your translated workflows in production! 🚀

## Authoring Rulesets & Customization
Orbiter can be extended to fit specific needs, patterns, or to support additional origins.
Expand Down Expand Up @@ -95,9 +88,9 @@ To extend or customize an existing ruleset, you can easily modify it with simple
7. Append the new [Rule](./Rules_and_Rulesets/index.md)
to the [`translation_ruleset`](./Rules_and_Rulesets/rulesets.md#orbiter.rules.rulesets.TranslationRuleset)

4. Invoke the `orbiter` CLI, pointing it at your customized ruleset, and writing output to an `output/` folder:
4. Invoke the [`orbiter translate`](./cli.md#translate) command, pointing it at your customized ruleset
```shell
orbiter translate workflow/ output/ --ruleset override.translation_ruleset
orbiter translate --ruleset override.translation_ruleset
```
5. Follow the remaining steps of the [Translate](#translate) instructions

Expand Down
2 changes: 1 addition & 1 deletion orbiter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
from typing import Any, Tuple

__version__ = "1.4.3"
__version__ = "1.5.0"

version = __version__

Expand Down
Loading

0 comments on commit 04763f8

Please sign in to comment.