diff --git a/proposals/.tackle.yaml b/proposals/.tackle.yaml index f32e4d52..81396dad 100644 --- a/proposals/.tackle.yaml +++ b/proposals/.tackle.yaml @@ -27,7 +27,7 @@ Proposal<_: description: A list of proposal IDs to link to default: [] -get_all_proposals()<_: +get_proposals()<_: files->: listdir --exclude ^tackle|scratch|templates|__pycache__|wip|.old output: [] proposals->: @@ -44,22 +44,22 @@ github_issue<-: repo: tackle get_by_num(issue_num int)<-: - data_>: http_get https://api.github.com/repos/{{org}}/{{repo}}/issues/{{issue_num}} - title->: var data.title - body->: var data.body + data: + _>: http_get https://api.github.com/repos/{{org}}/{{repo}}/issues/{{issue_num}} + headers: + Authorization: "token {{get_github_token()}}" + Accept: "application/vnd.github.v3+json" + return->: data update<-: issue_number: int title: str body: str status: str - github_token: - type: str - default->: get_github_token exec: ->: http_patch https://api.github.com/repos/{{org}}/{{repo}}/issues/{{issue_number}} headers: - Authorization: "token {{github_token}}" + Authorization: "token {{get_github_token()}}" Accept: "application/vnd.github.v3+json" json: title: "{{title}}" @@ -79,14 +79,34 @@ update_header(p Proposal)<-: --- body->: update_section {{p.file}} {{var(header_tpl)}} start-header end-header +update_readme()<-: + proposals->: get_proposals + status_map: + implemented: Implemented + accepted: Accepted + deferred: Deferred + considering: Considering + wip: WIP + rejected: Rejected + abandoned: Abandoned + + readme_table: + ->: var + input: | + | Title | Status | Description | Blockers | + | --- | --- | --- | --- | + {% for p in proposals %}| [{{p.title}}]() | {{status_map[p.status]}} | {{p.description}} | {%for i in p.blockers%}[{{i}}]()
{%endfor%} | + {% endfor %} + update readme table->: update_section README.md {{readme_table}} + <-: help: Update all issues exec: - do->: - for: p in get_all_proposals() - remote->: github_issue get_by_num p.number - body->: read_section {{p.file}} start-body end-body - + Update Proposals->: + for: p in get_proposals() + remote->: github_issue get_by_num {{p.issue_num}} + Update title_>: update_header {{p}} + body->: read_section {{p.file}} start-header end-body Update Github_>: ->: github_issue update if: remote.title!=p.title or remote.body!=body @@ -95,4 +115,4 @@ update_header(p Proposal)<-: body: "{{body}}" status: "{{p.status}}" - Update title_>: update_header {{p}} + Update Readmes->: update_readme diff --git a/proposals/README.md b/proposals/README.md index f792abec..7cb01dee 100644 --- a/proposals/README.md +++ b/proposals/README.md @@ -3,48 +3,48 @@ [//]: # (DO NOT MODIFY - Generate with `tackle` in this directory) [//]: # (--start--) -| Name | Status | Description | Blockers | Related To | -| --- | --- | --- | --- | --- | -| AST Upgrade | WIP | - | | [] | -| Abbreviate Kwargs | WIP | Allow kwarg flags to be shortened / abbreviated - ie `foo --bar baz` to `foo -b baz` | ast-parser
peg-parser
| [] | -| Allow hooks to be called in fields | WIP | Right now you can call hooks from rendering fields but would be great to use an arrow notation as well. | | [] | -| Command Arrow | Considering | Add a new arrow to indicate calling a command. | | [] | -| Complex Types | Implemented | Allow complex types including hook types | | [] | -| Context Composition | WIP | Upgrade the main context object from inheritance to a composition based model. | | [] | -| Declarative hook config parameters | WIP | Expose config parameters for pydantic's BaseModel to declarative hooks. | | [] | -| Default Methods as a Hook | Considering | Allow setting literal values if the first arg is | | None | -| Default hook | Implemented | When running a tackle file, it can help to have a default hook to run. | | [] | -| Default hook methods | Considering | None | | [] | -| Hook Access Modifiers | Implemented | Make hooks either public or private allowing distinction for what is in `tackle help`. | | [] | -| Hook Defaults | Implemented | Declarative hook default values should be parsed for hook calls. | | [] | -| Hook Directory as the Base Directory | Accepted | This proposal would make the tackle file optional allowing the hooks directory to act alone. | | [] | -| Hook Methods | Implemented | Allow creating hooks within hooks that act like methods with parameter inheritance. | | [] | -| Improve Loop Parser | WIP | Improve the loop parsing logic to allow declaring variables, ie `for: i in a_list`. - | | ['peg-parser'] | -| Overrides Improvements | WIP | Improve how overrides are tracked and applied when parsing files / hooks | | [] | -| PEG Parser | WIP | Update the current regex based parser to a PEG parser. | | [] | -| Partial Generation | Deferred | Generate / update parts of files instead of the whole file | | [] | -| Path Tracking Improvements | WIP | Modify how paths are tracked and made available through special variables. | | [] | -| Pydantic v2.0 Upgrade | WIP | Upgrade to pydantic version 2.0 | | [] | -| Remote Providers | WIP | Move the majority of the providers to remote locations | | [] | -| Reorganize the Providers | Implemented | Reorganize the providers into more logical groups. | | [] | -| Splat Operators | WIP | Allow splat operators to instantiate hooks - ie `a_hook **a_dict` or `a_hook *a_list` | ast-parser
peg-parser
| [] | -| Structured File Hook Shared Functions | Considering | Update all the structured file hooks (ie yaml, json, toml, and ini) to have shared functions. | | [] | -| URL Input Strings | Considering | Allow URLs to be input into tackle directly and make requests a dependency. | | [] | +| Title | Status | Description | Blockers | +| --- | --- | --- | --- | +| [Declarative Hook Config]() | Implemented | Allow hooks to have a model_config parameter exposing pydantic config params | | +| [Peg Parser]() | WIP | Change the parser from regex to PEG | | +| [Special Args]() | WIP | Reserve some arguments for use with tackle (ie import, freeze, update) | | +| [Tackle Test Rigging]() | WIP | None | | +| [Default Hook]() | Implemented | Allow files to have a default hook to be called when no arguments are supplied | | +| [Reserved Fields]() | WIP | Change the syntax of reserved fields to reduce potential conflicts | | +| [Hook Methods]() | WIP | Allow creating hooks within hooks that act like methods with parameter inheritance. | | +| [Provider Reorg]() | Implemented | Reorganize the providers into logical groups | | +| [Return Hook]() | Implemented | None | | +| [Hook Alias]() | WIP | Alias hooks so they can be called easier | | +| [Complex Type Use]() | WIP | Using complex types has issues | | +| [Test Keys]() | WIP | Create a special `test` key that can run tests next to the code | | +| [URL Inputs]() | WIP | Accept generic URLs for inputs | | +| [Hook Instantiation]() | WIP | Open the concept of using methods on instantiated hooks | | +| [Filters / Pipe Operators]() | WIP | Allow for jinja / bash style filters / pipes | | +| [Typed Macros]() | WIP | Allow creation of macros from within tackle files | | +| [Async Hook Calls]() | WIP | Add async functionality to the parser | | +| [Self Hook]() | WIP | Create a special `self` hook to reference the hook's methods during parsing | | +| [Native Providers in Individual Repos]() | WIP | Move the majority of the providers to remote locations | | +| [Structured File Hook Shared Functions]() | Considering | Update all the structured file hooks (ie yaml, json, toml, and ini) to have shared functions. | | +| [Hook Field Validators]() | Implemented | Validate fields with custom logic similar to pydantic's validation | | +| [Hooks Dir as Base]() | Implemented | Allow the base of a provider be either a hooks dir or tackle file | | +| [Return Key]() | WIP | Create a special key for returning the value when parsing | | +| [Pre / Post Context]() | Implemented | Break up the context into pre and post hook parsing groups of data to allow importing hooks | | +| [Context Composition]() | Implemented | Changing core context from inheritance based object to composition | | +| [Pydantic 2.0 Upgrade]() | Implemented | Upgrade to pydantic version 2.0 | | +| [Hook Field Defaults]() | Implemented | Allow flexible ways to declare hook field defaults | | +| [Splat Operators]() | Implemented | Allow splat operators to instantiate hooks - ie `a_hook **a_dict` or `a_hook *a_list` | [ast-parser]()
[peg-parser]()
| +| [Hook Access Modifiers]() | Implemented | Make hooks either public or private allowing distinction for what is in `tackle help`. | | +| [Private + Bare `exec` Method (ie `exec<_` / `exec`)]() | WIP | None | | +| [Complex Types]() | Implemented | Declaring hooks as types | | +| [Overrides Improvements]() | WIP | Improve how overrides are tracked and applied when parsing files / hooks | | +| [Path Tracking]() | WIP | Modify how paths are tracked and made available through special variables. | | +| [Command Arrow]() | WIP | Add macro to easily call commands on different platforms | | +| [AST Upgrade]() | WIP | Upgrade string parsers to use an AST | [context-composition]()
| +| [Loop Variable Update]() | Implemented | Improve the loop parsing logic to allow declaring variables, ie `i in a_list`. | | +| [Base Methods as Hooks]() | WIP | Allow base methods to be called directly as hooks | | +| [Remote Provider Cache]() | WIP | Create a cache for remote providers to minimize network calls to git on ever provider import | | +| [Method Properties]() | WIP | Methods could have properties which inform their behaviour | | [//]: # (--end--) - -### Status - -Implemented -Accepted -WIP -Rejected -Deferred -Abandoned - -## Not implemented - -In GH issue - +> Table generated with Tackle diff --git a/proposals/ast-parser.md b/proposals/ast-parser.md index 7eef4e2a..631bc51c 100644 --- a/proposals/ast-parser.md +++ b/proposals/ast-parser.md @@ -13,13 +13,9 @@ blockers: Upgrade string parsers to use an AST -- Proposal Status: [WIP](README.md) -- Issue Number: [1](https://github.com/sudoblockio/tackle/issue/1) -- Blockers: - - [Context Composition](https://github.com/sudoblockio/tackle/issue/1) - +- Proposal Status: [wip](README.md#status) +- Issue Number: [172](https://github.com/sudoblockio/tackle/issue/172) --- - [//]: # (--end-header--start-body--MODIFY) Current parsing is based on regex which works in most use cases but has become: diff --git a/proposals/async.md b/proposals/async.md index 08b02b58..1f48a35f 100644 --- a/proposals/async.md +++ b/proposals/async.md @@ -8,10 +8,15 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - # Async Hook Calls +Add async functionality to the parser + +- Proposal Status: [wip](README.md#status) +- Issue Number: [226](https://github.com/sudoblockio/tackle/issue/226) +--- +[//]: # (--end-header--start-body--MODIFY) + Would be cool to implement async functionality but would need another arrow to define the hook as being awaitable. ```yaml diff --git a/proposals/base-methods-as-hooks.md b/proposals/base-methods-as-hooks.md index 67f7c87a..85947970 100644 --- a/proposals/base-methods-as-hooks.md +++ b/proposals/base-methods-as-hooks.md @@ -8,11 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Base Methods as Hooks -# Proposal: Default Methods as Hooks +Allow base methods to be called directly as hooks -> Status: Not Implemented +- Proposal Status: [wip](README.md#status) +- Issue Number: [233](https://github.com/sudoblockio/tackle/issue/233) +--- +[//]: # (--end-header--start-body--MODIFY) This proposal would allow setting literal values if the first arg is a default method - either `if`, `else`, `when`, or `for`. All other kwargs fail. diff --git a/proposals/command-arrow.md b/proposals/command-arrow.md index 6f503387..8bfd3451 100644 --- a/proposals/command-arrow.md +++ b/proposals/command-arrow.md @@ -8,11 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - # Command Arrow -> Status: Not implemented +Add macro to easily call commands on different platforms + +- Proposal Status: [wip](README.md#status) +- Issue Number: [227](https://github.com/sudoblockio/tackle/issue/227) +--- +[//]: # (--end-header--start-body--MODIFY) It is very common to want to run a system command which tackle should make simple. Issue is the parser and general mechanics are not very elegant right now. Solution should be clean to make it on par with being able to create a Makefile. diff --git a/proposals/complex-type-use.md b/proposals/complex-type-use.md index 8dd064b6..d89788df 100644 --- a/proposals/complex-type-use.md +++ b/proposals/complex-type-use.md @@ -9,10 +9,15 @@ blockers: [] [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - # Complex Type Use +Using complex types has issues + +- Proposal Status: [wip](README.md#status) +- Issue Number: [228](https://github.com/sudoblockio/tackle/issue/228) +--- +[//]: # (--end-header--start-body--MODIFY) + Currently we allow declaring types for fields within a declarative hook and can have those fields validated when the hook is called but can't create fields which are validated on assignment. This prevents creation of typed data types like `list[str]` or `list[Foo]` within a hook. ### Examples diff --git a/proposals/complex-types.md b/proposals/complex-types.md index ff50b3ca..196d791f 100644 --- a/proposals/complex-types.md +++ b/proposals/complex-types.md @@ -8,10 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Complex Types +Declaring hooks as types -# Complex Types +- Proposal Status: [implemented](README.md#status) +- Issue Number: [229](https://github.com/sudoblockio/tackle/issue/229) +--- +[//]: # (--end-header--start-body--MODIFY) Would be good if a declarative hook field was able to be typed like another hook would be. This would allow nesting of typed structures as is common in many schema oriented operations. diff --git a/proposals/context-composition.md b/proposals/context-composition.md index 6aa094e4..6a0ff9ae 100644 --- a/proposals/context-composition.md +++ b/proposals/context-composition.md @@ -8,11 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - # Context Composition -> Status: WIP +Changing core context from inheritance based object to composition + +- Proposal Status: [implemented](README.md#status) +- Issue Number: [230](https://github.com/sudoblockio/tackle/issue/230) +--- +[//]: # (--end-header--start-body--MODIFY) This proposal would be for refactoring the core context object from an inheritance to a composition based approach. Would have broad implications across the entire stack. This is some long standing technical debt that needs to be paid at some point. diff --git a/proposals/declarative-hook-config.md b/proposals/declarative-hook-config.md index e37f7ddf..0633ce19 100644 --- a/proposals/declarative-hook-config.md +++ b/proposals/declarative-hook-config.md @@ -17,11 +17,6 @@ Allow hooks to have a model_config parameter exposing pydantic config params --- [//]: # (--end-header--start-body--MODIFY) - -# Declarative Hook Config - -> Status: WIP - We should be able to customize the config on a declarative hook since it is possible with a python hook. For this though, we need to worry about order of operations as: 1. The config is normally set on the base hook so we'll need to override that diff --git a/proposals/default-hook.md b/proposals/default-hook.md index ea8f3b1e..a1684ce6 100644 --- a/proposals/default-hook.md +++ b/proposals/default-hook.md @@ -10,17 +10,13 @@ blockers: [] # Default Hook -Allow files to have a default hook to be called +Allow files to have a default hook to be called when no arguments are supplied - Proposal Status: [implemented](README.md#status) - Issue Number: [232](https://github.com/sudoblockio/tackle/issue/232) --- [//]: # (--end-header--start-body--MODIFY) -# Default Hook - -> Status: Implemented - Currently, there is no way to call a tackle file without an argument and have any kind of exposed schema which would lend itself to building a defined schema that could be rendered into a help screen. This proposal aims at defining that default interface so that ### Questions diff --git a/proposals/exec-method-arrows.md b/proposals/exec-method-arrows.md index 02f6ce51..6a71d1ad 100644 --- a/proposals/exec-method-arrows.md +++ b/proposals/exec-method-arrows.md @@ -1,6 +1,6 @@ --- id: -title: Exec Method Arrows +title: Private + Bare `exec` Method (ie `exec<_` / `exec`) status: wip description: issue_num: 248 @@ -8,10 +8,15 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - # Private + Bare `exec` Method (ie `exec<_` / `exec`) +None + +- Proposal Status: [wip](README.md#status) +- Issue Number: [248](https://github.com/sudoblockio/tackle/issue/248) +--- +[//]: # (--end-header--start-body--MODIFY) + The `exec` method on a declarative hook is special in that when it exists, the return of the hook is public data from parsing it. This is how we can make dcl hooks into functions with typed inputs. For example: ```yaml diff --git a/proposals/hook-access-modifiers.md b/proposals/hook-access-modifiers.md index fc6ac13b..4a2b35d2 100644 --- a/proposals/hook-access-modifiers.md +++ b/proposals/hook-access-modifiers.md @@ -8,11 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Hook Access Modifiers -# Access Modifiers +Make hooks either public or private allowing distinction for what is in `tackle help`. -> Status: Implemented +- Proposal Status: [implemented](README.md#status) +- Issue Number: [235](https://github.com/sudoblockio/tackle/issue/235) +--- +[//]: # (--end-header--start-body--MODIFY) Hooks right now are all in the same namespace but if they are to be used as interfaces / rendered into help, they need to be namespaced in a way that allows collections of hooks to be exposed and others to remain hidden. The natural way to do this would be in allowing hooks with different signs to play a role in different diff --git a/proposals/hook-alias.md b/proposals/hook-alias.md index 55a0272e..ef6f48ad 100644 --- a/proposals/hook-alias.md +++ b/proposals/hook-alias.md @@ -8,6 +8,13 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) +# Hook Alias + +Alias hooks so they can be called easier + +- Proposal Status: [wip](README.md#status) +- Issue Number: [236](https://github.com/sudoblockio/tackle/issue/236) +--- [//]: # (--end-header--start-body--MODIFY) Would be nice to be able to define aliases for a hook to make them easier to call. For instance the `listdir` hook could additionally be called with `list_dir` or `dir_list`: diff --git a/proposals/hook-field-defaults.md b/proposals/hook-field-defaults.md index 46bae3be..8e72a533 100644 --- a/proposals/hook-field-defaults.md +++ b/proposals/hook-field-defaults.md @@ -8,11 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Hook Field Defaults -# Hook Defaults +Allow flexible ways to declare hook field defaults -> Status: Implemented +- Proposal Status: [implemented](README.md#status) +- Issue Number: [237](https://github.com/sudoblockio/tackle/issue/237) +--- +[//]: # (--end-header--start-body--MODIFY) Declarative hook default values should be parsed for hook calls. diff --git a/proposals/hook-field-validators.md b/proposals/hook-field-validators.md index 1274b121..d5fe25b2 100644 --- a/proposals/hook-field-validators.md +++ b/proposals/hook-field-validators.md @@ -2,12 +2,19 @@ id: hook-field-validators title: Hook Field Validators status: implemented -description: Allow +description: Validate fields with custom logic similar to pydantic's validation issue_num: 241 blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) +# Hook Field Validators + +Validate fields with custom logic similar to pydantic's validation + +- Proposal Status: [implemented](README.md#status) +- Issue Number: [241](https://github.com/sudoblockio/tackle/issue/241) +--- [//]: # (--end-header--start-body--MODIFY) ## Examples diff --git a/proposals/hook-instantiation.md b/proposals/hook-instantiation.md index e7955557..bc5f15f5 100644 --- a/proposals/hook-instantiation.md +++ b/proposals/hook-instantiation.md @@ -8,8 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Hook Instantiation + +Open the concept of using methods on instantiated hooks +- Proposal Status: [wip](README.md#status) +- Issue Number: [238](https://github.com/sudoblockio/tackle/issue/238) +--- +[//]: # (--end-header--start-body--MODIFY) When calling methods, in the past we have opted for converging the fields of method into the base like this. diff --git a/proposals/hook-methods.md b/proposals/hook-methods.md index ac576e5b..803fddc3 100644 --- a/proposals/hook-methods.md +++ b/proposals/hook-methods.md @@ -10,17 +10,13 @@ blockers: [] # Hook Methods -Hooks should have methods that can be called against the hook +Allow creating hooks within hooks that act like methods with parameter inheritance. - Proposal Status: [wip](README.md#status) - Issue Number: [239](https://github.com/sudoblockio/tackle/issue/239) --- [//]: # (--end-header--start-body--MODIFY) -# Hook Methods - -> Status: Implemented - Right now the order of operations for how to run and access a hook method is all messed up and needs to be rebuilt. Current there are two places where methods can be called, 1, within a tackle file and 2, from command line. Ideally they should be converged. ## Old Implmentation diff --git a/proposals/hooks-dir-as-base.md b/proposals/hooks-dir-as-base.md index 4ae39674..7caef346 100644 --- a/proposals/hooks-dir-as-base.md +++ b/proposals/hooks-dir-as-base.md @@ -8,11 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Hooks Dir as Base -# Hooks Directory as Base +Allow the base of a provider be either a hooks dir or tackle file -> Status: Not Implemented +- Proposal Status: [implemented](README.md#status) +- Issue Number: [240](https://github.com/sudoblockio/tackle/issue/240) +--- +[//]: # (--end-header--start-body--MODIFY) When there is no tackle file in a directory, it would be appropriate to instead check if there is a hooks dir as well since if there was a tackle file, then those hooks in the hooks dir would also be parsed. diff --git a/proposals/loop-variable-update.md b/proposals/loop-variable-update.md index 6ee4ced8..b236bd2b 100644 --- a/proposals/loop-variable-update.md +++ b/proposals/loop-variable-update.md @@ -2,18 +2,20 @@ id: loop-variable-update title: Loop Variable Update status: implemented -description: | - Improve the loop parsing logic to allow declaring variables, ie `for: i in a_list`. +description: Improve the loop parsing logic to allow declaring variables, ie `i in a_list`. issue_num: 234 blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Loop Variable Update -# Loop Update +Improve the loop parsing logic to allow declaring variables, ie `i in a_list`. -> Status: WIP +- Proposal Status: [implemented](README.md#status) +- Issue Number: [234](https://github.com/sudoblockio/tackle/issue/234) +--- +[//]: # (--end-header--start-body--MODIFY) Currently the loop logic inserts temporary variables `item` and `index` into the context so that they are available for rendering but this results in overlapping variables in embedded loops. What would be better is if we supported inserting the variable as part of the `for` key with `var_name in a_list` and similar semantics. Would require overhauling the parser some custom tokenizer. diff --git a/proposals/method-properties.md b/proposals/method-properties.md index 2dcf39d6..9c7b71da 100644 --- a/proposals/method-properties.md +++ b/proposals/method-properties.md @@ -8,10 +8,15 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - # Method Properties +Methods could have properties which inform their behaviour + +- Proposal Status: [wip](README.md#status) +- Issue Number: [242](https://github.com/sudoblockio/tackle/issue/242) +--- +[//]: # (--end-header--start-body--MODIFY) + It would be helpful if we could expose the control of how methods operated with parameters such as: - `merge` - Informs if the method's output is merged into the top level keys - the default behaviour. False would keep the data under the method name (see below). diff --git a/proposals/overrides-improvements.md b/proposals/overrides-improvements.md index 9fc56020..0759b120 100644 --- a/proposals/overrides-improvements.md +++ b/proposals/overrides-improvements.md @@ -8,10 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Overrides Improvements +Improve how overrides are tracked and applied when parsing files / hooks -> Status: WIP +- Proposal Status: [wip](README.md#status) +- Issue Number: [247](https://github.com/sudoblockio/tackle/issue/247) +--- +[//]: # (--end-header--start-body--MODIFY) Overrides are needed for testing as input fields need values inserted for testing. diff --git a/proposals/path-tracking.md b/proposals/path-tracking.md index c6d57c98..afb65b1c 100644 --- a/proposals/path-tracking.md +++ b/proposals/path-tracking.md @@ -8,13 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - # Path Tracking -> Status: Not implemented +Modify how paths are tracked and made available through special variables. -> Blocked by [Context Composition](context-composition.md) proposal +- Proposal Status: [wip](README.md#status) +- Issue Number: [244](https://github.com/sudoblockio/tackle/issue/244) +--- +[//]: # (--end-header--start-body--MODIFY) There is some ambiguity about what the current directory is. Current logic is diff --git a/proposals/peg-parser.md b/proposals/peg-parser.md index 7ba36f41..22a6e081 100644 --- a/proposals/peg-parser.md +++ b/proposals/peg-parser.md @@ -17,10 +17,6 @@ Change the parser from regex to PEG --- [//]: # (--end-header--start-body--MODIFY) -# Peg Parser - -> Status: Not implemented - The parser isn't very good now and should be overhauled. This was always the plan but the current regex based approach was sufficient to continue at the time. This will enable: diff --git a/proposals/pipe-operators.md b/proposals/pipe-operators.md index 7435d5d8..fe25c441 100644 --- a/proposals/pipe-operators.md +++ b/proposals/pipe-operators.md @@ -8,6 +8,13 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) +# Filters / Pipe Operators + +Allow for jinja / bash style filters / pipes + +- Proposal Status: [wip](README.md#status) +- Issue Number: [249](https://github.com/sudoblockio/tackle/issue/249) +--- [//]: # (--end-header--start-body--MODIFY) ```yaml diff --git a/proposals/pre-post-context.md b/proposals/pre-post-context.md index 74ecc54a..92761454 100644 --- a/proposals/pre-post-context.md +++ b/proposals/pre-post-context.md @@ -2,14 +2,20 @@ id: title: Pre / Post Context status: implemented -description: +description: Break up the context into pre and post hook parsing groups of data to allow importing hooks issue_num: 251 blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Pre / Post Context + +Break up the context into pre and post hook parsing groups of data to allow importing hooks +- Proposal Status: [implemented](README.md#status) +- Issue Number: [251](https://github.com/sudoblockio/tackle/issue/251) +--- +[//]: # (--end-header--start-body--MODIFY) Right now all context outside of a declarative hook call is called after the declarative hook is executed. This sort of goes against how a typical program would be structured where definitions outside of a function are called by means of importing the module. In tackle, it would be nice if the parsing of that context was optional to have called before a function is imported. Since order of the function and the context makes the most sense to inform what context is parsed before the function is called vs after, this proposal suggests breaking up the parsing into these two sections. diff --git a/proposals/provider-reorg.md b/proposals/provider-reorg.md index 591084eb..90005978 100644 --- a/proposals/provider-reorg.md +++ b/proposals/provider-reorg.md @@ -17,15 +17,6 @@ Reorganize the providers into logical groups --- [//]: # (--end-header--start-body--MODIFY) -# Provider Re-organization - -> Status: Implemented - -## Issues - -- Overlapping dependencies - - Can be dealt with by skipping importing hooks - ## New Provider List - json diff --git a/proposals/pydantic-2-upgrade.md b/proposals/pydantic-2-upgrade.md index 9420b81c..edb7dd9e 100644 --- a/proposals/pydantic-2-upgrade.md +++ b/proposals/pydantic-2-upgrade.md @@ -8,11 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Pydantic 2.0 Upgrade -# Pydantic 2.0 Upgrade Checklist +Upgrade to pydantic version 2.0 -> Status: Not implemented +- Proposal Status: [implemented](README.md#status) +- Issue Number: [253](https://github.com/sudoblockio/tackle/issue/253) +--- +[//]: # (--end-header--start-body--MODIFY) - Custom Field - Need to create new Field object poc diff --git a/proposals/remote-providers-cache.md b/proposals/remote-providers-cache.md index 9b8ce830..92f25334 100644 --- a/proposals/remote-providers-cache.md +++ b/proposals/remote-providers-cache.md @@ -2,16 +2,20 @@ id: title: Remote Provider Cache status: wip -description: +description: Create a cache for remote providers to minimize network calls to git on ever provider import issue_num: 255 blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Remote Provider Cache +Create a cache for remote providers to minimize network calls to git on ever provider import -# Remote Provider Cache +- Proposal Status: [wip](README.md#status) +- Issue Number: [255](https://github.com/sudoblockio/tackle/issue/255) +--- +[//]: # (--end-header--start-body--MODIFY) ### Cache Path diff --git a/proposals/remote-providers.md b/proposals/remote-providers.md index 6d23f593..1f8c9f57 100644 --- a/proposals/remote-providers.md +++ b/proposals/remote-providers.md @@ -8,6 +8,13 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) +# Native Providers in Individual Repos + +Move the majority of the providers to remote locations + +- Proposal Status: [wip](README.md#status) +- Issue Number: [254](https://github.com/sudoblockio/tackle/issue/254) +--- [//]: # (--end-header--start-body--MODIFY) Over time the intention will likely be to move most of the native providers to a version controlled repo that is imported. Before doing this, we need to implement a better caching strategy for how providers are pulled in at startup. diff --git a/proposals/reserved-fields.md b/proposals/reserved-fields.md new file mode 100644 index 00000000..8b7eea50 --- /dev/null +++ b/proposals/reserved-fields.md @@ -0,0 +1,110 @@ +--- +id: +title: Reserved Fields +status: wip +description: Change the syntax of reserved fields to reduce potential conflicts +issue_num: 243 +blockers: [] +--- +[//]: # (--start-header--DO NOT MODIFY) + +# Reserved Fields + +Change the syntax of reserved fields to reduce potential conflicts + +- Proposal Status: [wip](README.md#status) +- Issue Number: [243](https://github.com/sudoblockio/tackle/issue/243) +--- +[//]: # (--end-header--start-body--MODIFY) + + +## Variable Rules + +- Reserved variables + - Very few that could clash +- Prefix underscore -> private + - Can't set externally +- Suffix with underscore + - Don't show up in docs + +## Variables + +### Reserved + +is_public: bool = False +args: list = [] +- For mapping args to inputs +kwargs: Union[str, dict] = None +- Only used in requests hook with render by default to upgrade to dict +kwargs: str = None +- This maps additional kwargs to a variable + +New +args_seperator_: str = None +- Can be set to a comma or something if you want to break up the args with that to a list + +V2 - 1 +is_public_: bool = False +args_: list = [] +kwargs_: str = None + +V2 - 1 +_is_public: bool = False +_args_: list = [] +_kwargs: str = None + +env_: Any = None +- Used in blocks / match hooks where new context is created. Needs to be public +- because it will be mutable within a hook (see match). +skip_output: bool = False +- Fields that should not be rendered by default +_render_exclude_default: set = { + 'input_context', + 'public_context', + 'hook_type', + 'else', +} +_render_exclude: set = {} +_render_by_default: list = [] + +### Private + +Used when rendering docs** +_doc_tags: list = [] +- For linking issues in the docs so others can potentially contribute +_issue_numbers: list = [] - TODO: Implement this +- Additional callout sections to be included at the top of the docs +_notes: list = [] +- Allow hooks to be sorted in the docs +_docs_order: int = 10 - Arbitrary high number so hooks can be sorted high or low +- Parameterized return type description for docs +_return_description: str = None +- Flag for skipping creating the docs for +_wip: bool = False + +```python +from tackle import BaseHook, HookConfig +from pydantic import ConfigDict + + +class SomeHook(BaseHook): + hook_name = 'foo' + bar: str + + model_config = ConfigDict( + extra='forbid', + ) + hook_config: HookConfig = HookConfig( + args=['bar'], + ) +``` + + +```yaml +foo<-: + bar: str + + Config: + + +``` diff --git a/proposals/return-hook.md b/proposals/return-hook.md index 02a34d30..7ee0a9d1 100644 --- a/proposals/return-hook.md +++ b/proposals/return-hook.md @@ -8,6 +8,13 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) +# Return Hook + +None + +- Proposal Status: [implemented](README.md#status) +- Issue Number: [256](https://github.com/sudoblockio/tackle/issue/256) +--- [//]: # (--end-header--start-body--MODIFY) > NOTE: See [return-key](return-key.md) for an additional macro for ergonomics. diff --git a/proposals/return-key.md b/proposals/return-key.md index 7b73e553..6b9c9ecf 100644 --- a/proposals/return-key.md +++ b/proposals/return-key.md @@ -1,4 +1,21 @@ - +--- +id: +title: Return Key +status: wip +description: Create a special key for returning the value when parsing +issue_num: 245 +blockers: [] +--- +[//]: # (--start-header--DO NOT MODIFY) + +# Return Key + +Create a special key for returning the value when parsing + +- Proposal Status: [wip](README.md#status) +- Issue Number: [245](https://github.com/sudoblockio/tackle/issue/245) +--- +[//]: # (--end-header--start-body--MODIFY) > Blocked by [return-hook](return-hook.md) diff --git a/proposals/self-hook.md b/proposals/self-hook.md index 1802288e..710a52d5 100644 --- a/proposals/self-hook.md +++ b/proposals/self-hook.md @@ -2,16 +2,20 @@ id: title: Self Hook status: wip -description: +description: Create a special `self` hook to reference the hook's methods during parsing issue_num: 258 blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Self Hook +Create a special `self` hook to reference the hook's methods during parsing +- Proposal Status: [wip](README.md#status) +- Issue Number: [258](https://github.com/sudoblockio/tackle/issue/258) --- +[//]: # (--end-header--start-body--MODIFY) ```yaml MyHook<-: diff --git a/proposals/special-args.md b/proposals/special-args.md index 5d77da03..29c3dce3 100644 --- a/proposals/special-args.md +++ b/proposals/special-args.md @@ -1,17 +1,22 @@ --- id: -title: Splat Syntax +title: Special Args status: wip -description: Allow for using splat syntax similar to how jinja uses it but in normal hook calls +description: Reserve some arguments for use with tackle (ie import, freeze, update) issue_num: 259 blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - # Special Args +Reserve some arguments for use with tackle (ie import, freeze, update) + +- Proposal Status: [wip](README.md#status) +- Issue Number: [259](https://github.com/sudoblockio/tackle/issue/259) +--- +[//]: # (--end-header--start-body--MODIFY) + Would be convenient to be able to call tackle with a couple reserved arguments for doing actions that should be integrated directly into tackle. For instance: `tackle freeze [provider_name]` diff --git a/proposals/splat-operators.md b/proposals/splat-operators.md index d6702f50..4efbb4eb 100644 --- a/proposals/splat-operators.md +++ b/proposals/splat-operators.md @@ -10,12 +10,14 @@ blockers: --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - +# Splat Operators -# Splat syntax support +Allow splat operators to instantiate hooks - ie `a_hook **a_dict` or `a_hook *a_list` -> Status: Not implemented +- Proposal Status: [implemented](README.md#status) +- Issue Number: [257](https://github.com/sudoblockio/tackle/issue/257) +--- +[//]: # (--end-header--start-body--MODIFY) > Could be done with the [peg parser proposal](./peg-parser.md) diff --git a/proposals/structured-file-hooks.md b/proposals/structured-file-hooks.md index 2ec02bb6..8dd135dd 100644 --- a/proposals/structured-file-hooks.md +++ b/proposals/structured-file-hooks.md @@ -8,11 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - # Structured File Hook Shared Functions -> Status: Not implemented +Update all the structured file hooks (ie yaml, json, toml, and ini) to have shared functions. + +- Proposal Status: [considering](README.md#status) +- Issue Number: [260](https://github.com/sudoblockio/tackle/issue/260) +--- +[//]: # (--end-header--start-body--MODIFY) The yaml, json, toml, and ini share a lot of the same operations and so should have some shared libraries. Right now we have a bloated `*_in_place` hook. In the future it would be good to have a shared library of operations that each tool wraps. diff --git a/proposals/test-keys.md b/proposals/test-keys.md index 767b5f30..f764000e 100644 --- a/proposals/test-keys.md +++ b/proposals/test-keys.md @@ -8,8 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) +# Test Keys + +Create a special `test` key that can run tests next to the code +- Proposal Status: [wip](README.md#status) +- Issue Number: [261](https://github.com/sudoblockio/tackle/issue/261) +--- +[//]: # (--end-header--start-body--MODIFY) ```yaml test<-: diff --git a/proposals/test_proposals.py b/proposals/test_proposals.py index 1e560387..d827f023 100644 --- a/proposals/test_proposals.py +++ b/proposals/test_proposals.py @@ -4,24 +4,25 @@ def test_proposal_default(): """Default behaviour is to run update everything - GH, table, header.""" output = tackle() + assert output + +def test_proposals_get_all_proposals(): + output = tackle('get_proposals') + assert len(output) > 2 + + +def test_proposals_update_readme(): + output = tackle('update_readme') assert output def test_proposals_get_github_token(): """This could fail depending on if the file / env var exists or not.""" output = tackle('get_github_token') - assert output def test_proposals_github_issue_get_by_num(): output = tackle('github_issue', 'get_by_num', 172) - assert output['title'] == 'AST Upgrade' - - -def test_proposals_get_all_proposals(): - output = tackle('get_all_proposals') - - assert len(output) > 2 diff --git a/proposals/testing-tackle.md b/proposals/testing-tackle.md index 63c6e468..55b65eea 100644 --- a/proposals/testing-tackle.md +++ b/proposals/testing-tackle.md @@ -8,6 +8,13 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) +# Tackle Test Rigging + +None + +- Proposal Status: [wip](README.md#status) +- Issue Number: [262](https://github.com/sudoblockio/tackle/issue/262) +--- [//]: # (--end-header--start-body--MODIFY) diff --git a/proposals/typed-macros.md b/proposals/typed-macros.md index c67d558c..24245b99 100644 --- a/proposals/typed-macros.md +++ b/proposals/typed-macros.md @@ -1,4 +1,21 @@ - +--- +id: +title: Typed Macros +status: wip +description: Allow creation of macros from within tackle files +issue_num: 250 +blockers: [] +--- +[//]: # (--start-header--DO NOT MODIFY) + +# Typed Macros + +Allow creation of macros from within tackle files + +- Proposal Status: [wip](README.md#status) +- Issue Number: [250](https://github.com/sudoblockio/tackle/issue/250) +--- +[//]: # (--end-header--start-body--MODIFY) ```python diff --git a/proposals/url-inputs.md b/proposals/url-inputs.md index a08411b6..5320ce8d 100644 --- a/proposals/url-inputs.md +++ b/proposals/url-inputs.md @@ -8,12 +8,14 @@ blockers: [] --- [//]: # (--start-header--DO NOT MODIFY) -[//]: # (--end-header--start-body--MODIFY) - - # URL Inputs -> Status: Not Implemented +Accept generic URLs for inputs + +- Proposal Status: [wip](README.md#status) +- Issue Number: [263](https://github.com/sudoblockio/tackle/issue/263) +--- +[//]: # (--end-header--start-body--MODIFY) At one point `requests` was removed from tackle as a requirement which didn't allow the use of http inputs. This proposal would revert that and allow calling http for both cli / hook inputs.