tools/internal/questwiring: justfileRecipe cannot find a recipe written name: dependencies

Open Beginner friendly
#2,896 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
79/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
testing

Research direction

Read tools/internal/questwiring/combat_page_check_test.go and search for existing justfileRecipe callers. Check how the helper identifies recipe headers, then add coverage for configure and for rejecting a prefix-only name; update observe_preset_test.go to use the helper. Done when dependency recipes are found, prefix matches are rejected, and the related tests pass.

Written by the indexing model from the issue text.

Description

backlog bug

The Go helper justfileRecipe in tools/internal/questwiring cannot find a recipe whose header is written name: dependencies, so a test that reads such a recipe fails with a false "has no recipe" message.

Evidence at fe99a482a

  • tools/internal/questwiring/combat_page_check_test.go:291 matches a recipe header only when the line is name followed by a space, or exactly name::
    if strings.HasPrefix(line, name+" ") || line == name+":" {
  • The recipe build-android-observe: _build-guard _require-ndk go-tools is in the justfile at the commit that adds it (the #2875 seam). A test that calls justfileRecipe(t, "build-android-observe") on that commit fails with justfile has no recipe build-android-observe, although the recipe is there.
  • The same header form is used by other recipes, for example configure: _cold-notice _build-guard ... (justfile, the configure recipe), so the defect is not specific to the new recipe.
  • The new test file works round it with its own lookup, observeRecipeText in tools/internal/questwiring/observe_preset_test.go, which matches name: as a prefix.

Not shown

  • Whether any existing test calls justfileRecipe on a name: dependencies recipe. None was searched for; a search of justfileRecipe(t, " names is the next step.
  • Whether the helper's author meant the name: match to take dependencies. Its comment says it reads "the header line and the indented body".

Falsifier

A test that calls justfileRecipe on a recipe written name: dependencies and gets its header and body.

Work

  1. Make the header match accept name: followed by a space or the end of the line, and name followed by a space (the parameter form), in combat_page_check_test.go.
  2. Add a case that finds configure (a dependency form) and a case that refuses a name that is only a prefix of another recipe's name (for example build-android against build-android-observe).
  3. Replace observeRecipeText in observe_preset_test.go with justfileRecipe once step 1 lands.

Found while building the observe preset (#2875). The helper fails loudly, so no test passes silently on it.

Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.