Giter VIP home page Giter VIP logo

adr-j's People

Contributors

adoble avatar dimasmith avatar dvaillant avatar koppor avatar leviter avatar sdavids avatar tkleiber avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

adr-j's Issues

Specifing templates as test resources does not run correctly in local IDE unit tests

Having the following code in a unit test:

Record record = new Record.Builder(docPath, dateFormatter)
				.id(67)
				.name("This is a new record ")
				.template("rsrc:template.md")
				.build();

		record.store();

fails if the unit test is run locally within the IDE:

Reason is that using rsrc:template.md causes the record builder to try and find template.md as a resource in a JAR file. But all files are stored in the normal file store.

In addition, there are missing unit tests in RecordTest.java for user specified templates.

Native build broken

The creation of native (GraalVM) images does not work and stops the build. Strong suspicion that this is due to the presence of the enum DataFormatterType in org.doble.commands.CommandConfig class which is used to specify the allowed parameters.

Currently have commented out the GraalVM native builds in both build.gradle and .travis.yml (the .circleci specification has not been changed and causes a build error with CircleCI).

Simplify tests

Some of the tests are (subjectively) more complicated than the code they test.

init after config does now work correctly

$ mkdir /tmp/test && cd "$_"
$ adr config dateFormat ISO_LOCAL_DATE
$ ls -A
.adr
$ adr init
Directory is already initialised for ADR.
$ adr new test
org.doble.adr.ADRException: FATAL: Unable to determine the indexes of the ADRs.
        at org.doble.commands.CommandNew.highestIndex(CommandNew.java:251)
        at org.doble.commands.CommandNew.call(CommandNew.java:132)
        at org.doble.commands.CommandNew.call(CommandNew.java:37)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at org.doble.adr.ADR.run(ADR.java:89)
        at org.doble.adr.ADR.main(ADR.java:65)
Caused by: java.nio.file.NoSuchFileException: /private/tmp/test/doc/adr
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:461)
        at java.base/java.nio.file.Files.newDirectoryStream(Files.java:481)
        at java.base/java.nio.file.Files.list(Files.java:3772)
        at org.doble.commands.CommandNew.highestIndex(CommandNew.java:248)
        ... 12 more

Have an edit command

Have a command to directly edit the ADR based on its id, e.g.:

adr edit 42

will open the configured editor on the ADR number 42.

Running adr command without arguments.

ADR 3 states that:

Running adr without any arguments lists the available subcommands

Current behavior is that an error message is returned. Needs correcting.

numberformatexception on new

when I try this I get:

adr new wiki migration
java.lang.NumberFormatException: For input string: "imag"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:668)
	at java.base/java.lang.Integer.<init>(Integer.java:1127)
	at org.doble.commands.CommandNew.toInt(CommandNew.java:264)
	at java.base/java.util.stream.ReferencePipeline$4$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.IntPipeline.reduce(IntPipeline.java:520)
	at java.base/java.util.stream.IntPipeline.max(IntPipeline.java:483)
	at org.doble.commands.CommandNew.highestIndex(CommandNew.java:251)
	at org.doble.commands.CommandNew.call(CommandNew.java:133)
	at org.doble.commands.CommandNew.call(CommandNew.java:40)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine.execute(CommandLine.java:2078)
	at org.doble.adr.ADR.run(ADR.java:99)
	at org.doble.adr.ADR.main(ADR.java:72)

ADR supercede is not updating the old adr reference with Superseded by

Iam trying with the ad-j tool to test adr related features and I see supercede functionality is partially working

This is the sequence of steps i followed

  1. adr init -i madr_initial.md -t madr.md -> Initial adr created under doc/adr
  2. Then I issued following command adr new Use Java -> I see new adr created
  3. Marked the status as Accepted in the newly created ADR
  4. Then I issued adr new -s 2 use Golang
  5. new ADR is created and in the new ADR i can see it Supercedes old ADR
  6. But in ADR 2 I don't see Superseded by references as mentioned in the documentation.

Am i missing something?

Extend to use other structures for architectural decision records

Suggestion:

adr init -t [template_file_name] [adr_folder]

The template_file_name specifies the structure and subsequent adr commands (such as adr new) use this structure.

Could also add adr check [template file name] to check if the template is correctly formed and allows the basic fields such as title, date etc.

Long option names

As well as the terse options such as -l have as alternative long option names such as --link

{{{link.file}}} is not resolved when using Asciidoc templates

Hi!

I have converted the example madr templates to Asciidoc.
example_templates.zip
When using this, {{{link.file}}} seems to empty in generation.
Problem seems to be the hard reference to markdown md in the glob variables in ADRFilter.java.

Example:
adr init -i \madr_initial.adoc -t \madr.adoc
adr new -link=1:"Amends":"Amended by" define template directory

Output:

  • Amends link:[ADR 1]

Environement: Windows 11, JRE 8

Best regards
Torsten

Generate man page

The current README page serves as a quick "getting started" to ADR-J. However, as the number of commands increases I would propose a more complete set of documentation (in addition to the README file) . Apparently this can be generated from the code annotations using tools provided by the PICOCLI project. This need to be investigated.

Publish on Homebrew

It would be nice if one could install adr-j via homebrew.

Similar to the existing brew install adr-tools.

Command help not always correctly rendered in windows terminal

Running the following in the Git Bash shell in windows terminal:

$ adr --help
←[31m←[1mUnknown option: '--help'←[21m←[39m←[0m
Usage: ←[1madr←[21m←[0m [COMMAND]
Creation and management of architectural decision records (ADRs)
Commands:
  ←[1minit←[21m←[0m     Initialise the directory of architecture decision records:
            * creates a subdirectory of the current working directory
            * creates the first ADR in that subdirectory, recording the
             decision to record architectural decisions with ADRs.
  ←[1mnew←[21m←[0m      Creates a new, numbered ADR.  The <title_text> arguments are
             concatenated to form the title of the new ADR. The ADR is opened
             for editing in the editor specified by the VISUAL or EDITOR
             environment variable (VISUAL is preferred; EDITOR is used if
             VISUAL is not set).  After editing, the file name of the ADR is
             output to stdout, so the command can be used in scripts.
  ←[1mlist←[21m←[0m     Lists the filenames of the currently created architecture decision
             records.
  ←[1mversion←[21m←[0m  Prints the version of adr-j.
  ←[1medit←[21m←[0m     Starts the editor on the specified ADR
  ←[1mconfig←[21m←[0m   List of the currently set properties.
  ←[1mlink←[21m←[0m     Links ADRs with one another.
  ←[1mhelp←[21m←[0m     Displays help information about the specified command
Exit Codes:
   0   Successful program execution.
  64   Invalid input: an unknown option or invalid parameter was specified.
  70   Execution exception: an exception occurred while executing the business
         logic.
Environment Variables:
  ADR_VISUAL   The editor to use to edit ADRs. Ignored, if ADR_EDITOR set
  ADR_AUTHOR   The author of the ADR
  ADR_EDITOR   The editor to use to edit ADRs

Add author field substitution

It would be useful to have an author field substitution.

The author could be determined by using the JVM property "user.name" or a new environment variable ADR_AUTHOR.

Update ADR 2

ADR 2 references an implementation in Java 8. Update with decision to use last LTS version of Java.

consider providing jbang catalog for easy usage

if you had a jbang-catalog defined we could do:

jbang app install adr@adoble and have it available as adr on any platform supporting java.

I didn't find adr jar published anywhere but by using jitpack you can mimck it:

jbang app install --name adr --repos jitpack -m org.doble.adr.ADR com.github.adoble:adr-j:LATEST

now you can runadr

I'll open PR with example catalog if you are interested. best would be if you created adoble/jbang-catalog repo then the name would just be adr@adoble rather than adr@adoble/adr-j

What does reverse_link_description in "adr new -l" do?

Hi!

reverse_link_description seems to imply to me, that in the previous ADR is created a reverse link too.
This is not the case, so what should the parameter do?

Example:
adr new -l=2:a:b test

New ADR contains:
* A [ADR 2](0002-define-template-directory.md)

Previous ADR 2 contains no link.

Environement: Windows 11, JRE 8

Best regards
Torsten

Have a config command

If some of the previous issues are implemented we are starting to have a number of options. Having all these handled during init is maybe too much and a developer may want to change them after initialization.

Propose a config command, e.g.:

adr config editor /usr/bin/vim
adr config dir docs/records
adr config template ~/templates/madr
adr config format asciidoc

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.