Code Monkey home page Code Monkey logo

adrust's People

Contributors

omallassi avatar pirosikick avatar rustysys-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

adrust's Issues

Title is rendered incorrectly

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.

Allow all configuration items to be overridden

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

Search | Improve search to search on title or tag or all

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 everything
  • adr search --title "bbb" would search on title only
  • adr search --tags "bla bla" would search on tags only

Describe alternatives you've considered
none

Additional context
none

Proposal: rename `--name` to `--title`

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"

Proposal: Support multiple config files

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.

  • create named profiles
  • current/default profile
  • import other config files (you could save a config file in git repository and share it)

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' 

Enforce state machine transitions

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.

Nested files are readable but cannot be created by the tool

@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

Format Code

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.

Crashing without file in ./src folder

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:

  1. Install on Windows
  2. Set new config values
  3. try creating new adr

Expected behavior
An Entry should be added

Desktop (please complete the following information):

  • OS: Windows 11
  • adr adr 0.1.0

Rework cli::list_all_*() to wrap the ADR structue thing

in cli/main.rs the methods
list_all_tags() should be reworked:

  • do not see the "tags::" thing
  • adr_repo... should return a ADR struct (proper encapsulation)

list_all_adr() should be reworked :

  • do not see the content struct
  • but manipulate a ADR Struct

Add ID column to the `adr list` command

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.

Rework Tags

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;
}

Check if / how to integrate cucumber tests into coverage

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 decision record from cli

Add a way to open a Decision Record from the command in your default editor.

  • if necessary define a config KV pair for the editor to use.
  • add command to open file: adr edit --name <str> or adr edit --id <int>

Be able to announce a decision

See If / who we could announce a decision.

For instance,

  • it could be a specific command e.g. adr accounce --decision ....
  • it could be done when a decision status is updated
  • it could be done through multiple medias (Slack, Microsoft Teams, emails etc...) which may drive security (authentication at least) questions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.