Skip to content

LUCENE-9916: add a simple regeneration help doc#73

Merged
rmuir merged 2 commits into
apache:mainfrom
rmuir:LUCENE-9916_help
Apr 11, 2021
Merged

LUCENE-9916: add a simple regeneration help doc#73
rmuir merged 2 commits into
apache:mainfrom
rmuir:LUCENE-9916_help

Conversation

@rmuir
Copy link
Copy Markdown
Member

@rmuir rmuir commented Apr 8, 2021

This probably isn't most efficient or the best, but its a start.

Some notes:

  • Using these steps to "force regenerate" results in local diffs. These look to be hashmap ordering differences or similar. We should fix these so that regeneration is fully idempotent?
  • Might not be the most efficient, for example when using --rerun-tasks the tidy is unnecessarily rerun even if its not necessary, which is actually quite slow. Is the tidy task really necessary or is it automatically/more efficiently done as some prerequisite of regenerate?

@rmuir rmuir requested a review from dweiss April 8, 2021 13:39
@uschindler
Copy link
Copy Markdown
Contributor

uschindler commented Apr 8, 2021

I have a question: why do we need this "tidy" at end of command line? If it is always required, it could be triggered automatically?

I know this is unrelated to the documentation issue, but whenever I see any of those instructions, this puts questions in my eyes: 🤔

Comment thread help/regeneration.txt Outdated

Regenerate code:

gradlew regenerate tidy
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would indexnt those lines. Maybe use Markdown for whole help files?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

FYI I followed the style of existing help docs which do not indent, see tests.txt. I would say +1 to markdown as the current format is alien, and markdown would give good rendering on github?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I hate those markup formats and live in txt world... Also, these files are sourced (and printed) as part of helpXXX tasks which you can invoke from gradlew. Don't know if this matters (I'm sure there is a plugin somewhere that renders them into ascii console opcodes...).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Markdown is a good compromise. I just think we should use as minimal as possible, but e.g. make code parts inside code blocks or indent, so its blockquoted(sourceformatted automatically.

I don't want full featured Markdown :-)

Copy link
Copy Markdown
Contributor

@dweiss dweiss left a comment

Choose a reason for hiding this comment

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

If you use regenerate ten I tried to make tidy an automatic follow-up. So in theory (and I think in practice at the moment) you can run ./gradlew regenerate --rerun-tasks and it should result in no differences.

Comment thread help/regeneration.txt Outdated

gradlew --rerun-tasks regenerate tidy

Force-regenerate code, except for one tokenizer which is extremely slow:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most regeneration tasks are incremental at the moment - they do sense if they need to run or not. There should be a big red "last resort" option in this help file because in 99% of cases this should do the job: gradlew regenerate. That's it. Skips over tasks that have the same inputs/ outputs, regenerates and tidies up everything else. I've tested it on Linux and Windows and it really does work. The trouble you fell into today was caused by the fact that you use the low-level regeneration task and regenerate has all sorts of tweaks to make those tasks incremental and clean up formatting, etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An example of when --rerun-tasks is useful is when you tweak the code of the generation task itself (not the inputs/outputs but the task itself).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I figured out that gradle also rexecutes tasks if you change its source file (at least in the past this worked). I tested this at least when developing the renderJavadocs classes.

@dweiss
Copy link
Copy Markdown
Contributor

dweiss commented Apr 8, 2021

Leave this patch open, Robert. There is one more non-trivial bit (checksum saving) that I need to explain there - I'll do it once I get back home.

@rmuir
Copy link
Copy Markdown
Member Author

rmuir commented Apr 8, 2021

sure, please anyone push improvements, i just wanted to get it started.

… regeneration task). Sorry for being verbose. Maybe somebody will read it. :)
@dweiss
Copy link
Copy Markdown
Contributor

dweiss commented Apr 8, 2021

I pushed a commit - sorry for being verbose. Hope this will helps you (and others) understand how I think it should work. Not every task is incremental yet (and I didn't clarify that).

@rmuir
Copy link
Copy Markdown
Member Author

rmuir commented Apr 8, 2021

super-helpful, thank you @dweiss !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants