omallassi / adrust Goto Github PK
View Code? Open in Web Editor NEWADRust: a tool in Rust to manage (Architecture) Decision Records
License: Apache License 2.0
ADRust: a tool in Rust to manage (Architecture) Decision Records
License: Apache License 2.0
After initially installing and configuring adr
I run the following command.
adr lf new --name "test adr"
This creates 000001-test-adr.adoc
in my source directory as expected. However the output of adr list
shows that the file was created with a broken title name.
16:08:46 🖎 adr 2m34s > adr list
Title | Date | Status | File | Tags
-------------+------------+--------+-------------------------------------------------+---------------------------------------
== test adr | 2019-10-28 | wip | /home/procyclinsur/adr/src/000001-test-adr.adoc | #Application_1 #Security #Deployment
Opening the file in vim confirms the title is malformed.
== == test adr
I am using the default template (at the moment). The title line from the template seems to be OK.
== {%%ADR TITLE%%}
I haven't looked into the rendering code yet, but I will be doing that shortly.
Looks like last version is 0.12.0
right now only some of the config items are configurable (conventions is apply for others). for instance you can only change "/tmp/adr-samples" and conventions will force "./templates" and "./src"
may be worth changing this.
is related to #17
based on https://crates.io/crates/cargo-tarpaulin ?
you can have cases where an ADR is complemented by multiple decisions and not only one.
the current (weak) implementation only support a one-to-one relationship.
should evolve to support one-to-many or even many-to-many relationships.
while using adr new command, today, the title in the .adoc is not set and do not override the template title...
should be improve to reuse the --name "" value and set the title
Tantivy-search support it https://github.com/tantivy-search/tantivy
Is your feature request related to a problem? Please describe.
With the increasing volume of ADRs, the search may be more efficient if a user can limit the scope to title, tags or all.
Describe the solution you'd like
An improvement of adr
would help. something like
adr search --query "bla bla "
would search on everythingadr search --title "bbb"
would search on title onlyadr search --tags "bla bla"
would search on tags onlyDescribe alternatives you've considered
none
Additional context
none
cargo outdated etc....
in particular clap that moved to v3..
today template name is hard-coded to adr-template-v0.1.adoc
.
may be worth to have something configurable.
is related to #16
this is not "revolution of the year", yet, Instead of running
adr new lf --name "my decision title"
we could run
adr new lf --title "my decision title"
or make it a cli option
e.g. adr list --sort status
or adr list --sort title
in cli.main.rs line # 141, init() should be moved to config mod
no need for configuration on this (at least for now)
I was thinking today about team use cases for adrust, and in particular having multiple projects for which you are writing adrs for.
to support this usecase, I propose a configuration profile manager. Since the configuration file is written in TOML, this manager could support the following.
to express this visually I have the following examples:
to create the config for the first example:
adr config new --name profile1 # create a new profile with default values
adr config default --name profile1 # set profile1 as default configuration profile
adr config set --name log_level --value 4 # set parameter value as currently done.
...
adr config new --name profile2
adr config set --name log_level --value 4 --profile profile2
...
example config 1:
default = "profile1"
[profile1]
log_level = 4
adr_src_dir = '/tmp/adr-samples/src'
adr_template_dir = '/tmp/adr-samples/templates'
adr_template_file = 'adr-template-v0.1.adoc'
adr_search_index = '/tmp/adr-samples/.index'
use_id_prefix = true
id_prefix_width = 6
[profile2]
log_level = 4
adr_src_dir = '/tmp/adr-samples/src'
adr_template_dir = '/tmp/adr-samples/templates'
adr_template_file = 'adr-template-v0.1.adoc'
adr_search_index = '/tmp/adr-samples/.index'
use_id_prefix = true
id_prefix_width = 6
to create the config for the second example:
adr config new --name profile1 --from /path/to/config/file.toml # Create file with defaults if !exists
adr config new --name profile2 --from /path/to/second/config/file.toml # Create file with defaults if !exists
adr config default --name profile2
example config 2:
default = "profile2"
[profile1]
config_source = '/path/to/config/file.toml'
[profile2]
config_source = '/path/to/second/config/file.toml'
or you could mix and match the styles:
adr config new --name profile1 # create a new profile with default values
adr config default --name profile1 # set profile1 as default configuration profile
adr config set --name log_level --value 4 # set parameter value as currently done.
...
adr config new --name profile2 --from /path/to/second/config/file.toml # Create file with defaults if !exists
example config 3:
default = "profile1"
[profile1]
log_level = 4
adr_src_dir = '/tmp/adr-samples/src'
adr_template_dir = '/tmp/adr-samples/templates'
adr_template_file = 'adr-template-v0.1.adoc'
adr_search_index = '/tmp/adr-samples/.index'
use_id_prefix = true
id_prefix_width = 6
[profile2]
config_source = '/path/to/second/config/file.toml'
the command completed-by (and other? ) cannot be used if one of the decision is not in status “decided”.
A check should be done priori to updating the files with an error message to the user.
should be able to run adr search --tags tag#1,tag#2
which will then be an AND
search.
Ability to find all Decision Record where "decided date" between x & y
builds are no longer available on travis - credit issue ...
should move everything - if feasible - on GitHub workflows
@omallassi Is this something that should be supported?
If so, the adr lf new
command will need to be fixed to add a --path
extender option.
create:
cargo run lf new --name mypath/number7
Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Running `target/debug/adr lf new --name mypath/number7`
Jun 04 22:39:14.531 ERRO Unable to copy template from ["/home/procyclinsur/adr/tmpl/adr-tmpl-v0.1.adoc"] to ["/home/procyclinsur/adr/src/000008-mypath/number7.adoc"]
Jun 04 22:39:14.533 ERRO Got error [Os { code: 2, kind: NotFound, message: "No such file or directory" }] while getting ADR ["/home/procyclinsur/adr/src/000008-mypath/number7.adoc"]
thread 'main' panicked at 'explicit panic', adr_core_local_impl/src/adr_repo/mod.rs:71:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
read:
cargo run list
Finished dev [unoptimized + debuginfo] target(s) in 0.09s
Running `target/debug/adr list`
Title | Date | Status | File | Tags
-----------------+------------+--------+-----------------------------------------------------------+--------------------
number7 | 2019-10-28 | wip | /home/procyclinsur/adr/src/000007-number7.adoc | #your #tags #here
number6 | 2019-10-28 | wip | /home/procyclinsur/adr/src/testfolder/000006-number6.adoc | #your #tags #here
number5 | 2019-10-28 | wip | /home/procyclinsur/adr/src/000005-number5.adoc | #your #tags #here
number4 | 2019-10-28 | wip | /home/procyclinsur/adr/src/000004-number4.adoc | #your #tags #here
number3 | 2019-10-28 | wip | /home/procyclinsur/adr/src/000003-number3.adoc | #your #tags #here
number2 | 2019-10-28 | wip | /home/procyclinsur/adr/src/000002-number2.adoc | #your #tags #here
Loki Log Design | 2019-10-28 | wip | /home/procyclinsur/adr/src/000001-loki-log-design.adoc | #your #tags #here
During my last PR, I was unable to use a preferred editor due to it auto formatting the code base. I would like to run the code though cargo fmt
so that Atom which uses cargo fmt
on save will no longer obscure the changes of a PR with extraneous formatting changes.
instead of duplicating them as of now.
Describe the bug
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 18446744073709551615', adr_core_local_impl\src\adr_repo\mod.rs:140:27
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
To Reproduce
Steps to reproduce the behavior:
Expected behavior
An Entry should be added
Desktop (please complete the following information):
in cli/main.rs the methods
list_all_tags() should be reworked:
list_all_adr() should be reworked :
In relation to #35 an id
column should be added to the output as below.
ID |Title | Date | Status | File | Tags
------+-----------------+------------+--------+--------------------------------------------------------+---------------------------------------
1 | Loki Log Design | 2019-10-28 | wip | /home/procyclinsur/adr/src/000001-loki-log-design.adoc | #Application_1 #Security #Deployment
where ID
is equivalent to the number attached to the filename with insignificant 0's dropped.
based on this https://github.com/tantivy-search/tantivy-cli and related REST APIs
to have either something from the config (could be complex) or search for
[tags]#deployment view# [tags]#network# [tags]#security#
in .adoc
file.
the [tag]
style has to be set in the stylesheet e.g.
.tags {
color: #fff;
padding: .1em .5em .2em;
font-weight: 500;
border-radius: .25em;
font-size: 90%;
background-color: #aaa6a6;
}
Following would be to use cargo-kcov. it was a test to integrate cucumber tests but it seems like kcov fails while reading cucumber
extract from https://travis-ci.org/omallassi/adrust/jobs/652901336
cargo-kcov 0.5.2
2836 Coverage found the following executables: ["/home/travis/build/omallassi/adrust/target/debug/adr_search-b83ba7d78b9cb9a6", "/home/travis/build/omallassi/adrust/target/debug/create_adr-600ddbd55dcf1721", "/home/travis/build/omallassi/adrust/target/debug/adr-54c7196f98ac1e56", "/home/travis/build/omallassi/adrust/target/debug/adr_config-ef1e10ed339cb571", "/home/travis/build/omallassi/adrust/target/debug/adr_core-fb277a0cdad7dd02"]
2837 Running "kcov" "--exclude-pattern=/home/travis/.cargo" "--verify" "/home/travis/build/omallassi/adrust/target/cov/adr_search-b83ba7d78b9cb9a6" "/home/travis/build/omallassi/adrust/target/debug/adr_search-b83ba7d78b9cb9a6"
2838
2839running 0 tests
2840
2841test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
2842
2843 Running "kcov" "--exclude-pattern=/home/travis/.cargo" "--verify" "/home/travis/build/omallassi/adrust/target/cov/create_adr-600ddbd55dcf1721" "/home/travis/build/omallassi/adrust/target/debug/create_adr-600ddbd55dcf1721"
2844No such file or directory (os error 2)
2845There was an error parsing "./features/adr_lifecycle"; aborting.
2846error: failed to get coverage
2847caused by: exit code: 1
The following coud be happened to .travis.yml
&&
sudo apt-get install cmake g++ pkg-config jq &&
cargo install --force cargo-kcov &&
cargo kcov --print-install-kcov-sh | sh &&
cargo kcov -vV &&
cargo kcov --verbose --coveralls --all --no-clean-rebuild &&
echo "Uploaded code coveralls via cargo-kcov"
Add a way to open a Decision Record from the command in your default editor.
adr edit --name <str>
or adr edit --id <int>
rm /Users/omallassi/Library/Preferences/rs.adrust-tools.adrust-tools/adrust-tools.toml
implement the completed-by --name ... --by ..
command
the ADR hierarchy can contain png, sub folders etc...
See If / who we could announce a decision.
For instance,
adr accounce --decision ....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.