Skip to content

Support inline references in Covers: field - #636

Open
InAnYan wants to merge 12 commits into
itsallcode:mainfrom
InAnYan:InAnYan/covers-inline
Open

InAnYan wants to merge 12 commits into
itsallcode:mainfrom
InAnYan:InAnYan/covers-inline

Conversation

@InAnYan

@InAnYan InAnYan commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Closes #617

DISCLAIMER: Made by AI, guided by me. I take full responsibility of the code. I have reviewed the code, and the code seems for me okay, but I don't have a big experience in the OFT codebase. Feel free to tell me if anything is off.

PR content:

  • Updated requirements (new dsn, similar to the ones for Needs:)
  • Updated user doc
  • Updated parsing logic, patterns, transitions
  • Tests

@github-project-automation github-project-automation Bot moved this to 📫 Backlog in OpenFastTrace Oct 18, 2026
@redcatbear redcatbear moved this from 📫 Backlog to 🎁 Ready for Review in OpenFastTrace Oct 23, 2026

@redcatbear redcatbear left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @InAnYan for this contribution. Nice addition.

I have a couple of small change requests to tighten the change.

Sorry for the late review. Very busy at the moment.

// [impl->dsn~md.covers-single-line~1]
/** Matches an inline requirement reference. Capture group 1 holds the first ID. */
public static final String REFERENCE_INLINE = "\\s*.*?("
+ SpecificationItemId.ID_PATTERN + ").*";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex feels to wide. The spaces should not appear here. Word boundary markers would be more fitting


// [utest->dsn~md.covers-single-line~1]
@ParameterizedTest
@ValueSource(strings = { " req~name~1", " `req~name~1`", "[link](#req~name~1)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example with the anchor is illegal. The anchor reference should not be recognized as valid reference.

A valid Markdown Link would look like this:

[feat~support-hid-devices~1](#support-human-interface-devices)

To be honest, I don't think the inline notation makes sense in combination with links, because they take up too much space and make the specs less readable than the bulleted version.

CODE_BEGIN(" *[`~]{3,30}\\w*\\s*"),
CODE_END(" *[`~]{3,30}\\s*"),
COMMENT("Comment:\\s*"),
COVERS_INT("Covers:" + PatternConstants.REFERENCE_INLINE),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be more strict please: Comma separated list after the colon with optional spaces.


// [utest->dsn~md.covers-single-line~1]
@ParameterizedTest
@CsvSource(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If its one dimensional, use ValueSource please.

// [utest->dsn~md.covers-single-line~1]
@ParameterizedTest
@CsvSource(
{ "Covers:", "#Covers: req~foo~1", "' Covers: req~foo~1'", "Covers: abc" })

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add bad weather scenarios for typical typos: semicolons instead of a colons, forgotten colon, joined IDs with no separator.

{
final SpecificationItem item = importText("""
req~subject~1
Covers: req~covered~2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use test with at least two values separated by comma, just to be sure.


// @formatter:off
COMMENT("Comment:\\s*"),
COVERS_INT("Covers:" + PatternConstants.REFERENCE_INLINE),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restrict to comma-separated list with optional spaces.

@github-project-automation github-project-automation Bot moved this from 🎁 Ready for Review to 🔨 In Progress in OpenFastTrace Nov 18, 2026
@InAnYan

InAnYan commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Hi! Thanks for the review! No pressure

I think I addressed most of the comments

@redcatbear redcatbear added the ai-assisted Written with the help of an LLM label Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Written with the help of an LLM feature

Projects

Status: 🔨 In Progress

Development

Successfully merging this pull request may close these issues.

Support inline requirement link in Covers: field

2 participants