Skip to content

[#31] Use mkDGitRevision only in executables

Maxim Koltsov requested to merge maksbotan/#31-enforce-mkDGitRevision-usage into master

Description

Problem: in the current state contract code (AbstractLedger and ManagedLedger) calls mkDGitRevision in the library component. There are two problems with that:

  • New commits and rebuilds of morley-ledgers executable potentially wont trigger git revision update in the contracts.
  • There is nowhere to get git revision from when morley-ledgers is used as a library.

Solution: introduce a new documentation section DGeneralInfoSection, which wraps git revision and potentially other things like contract author, and insert this section in the contract code. Then make a wrapper buildInstrDocWithGitRev which finds DGeneralInfoSection and patches it with git revision provided by the caller. It is expected to be called only from the executable.

Related issue(s)

Resolves #31 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Merge request reports