Skip to content

[MSHARED-1326] Improve (documentation on) MavenReport interface - #19

Merged
asfgit merged 1 commit into
masterfrom
MSHARED-1326
Nov 6, 2023
Merged

[MSHARED-1326] Improve (documentation on) MavenReport interface#19
asfgit merged 1 commit into
masterfrom
MSHARED-1326

Conversation

@michael-o

@michael-o michael-o commented Oct 22, 2023

Copy link
Copy Markdown
Member

A possible improvement w/o renaming any methods.

@michael-o
michael-o requested a review from hboutemy October 22, 2023 19:54
@michael-o

michael-o commented Oct 22, 2023

Copy link
Copy Markdown
Member Author

@kriegaex

@michael-o

Copy link
Copy Markdown
Member Author

@kriegaex I'd first to normalize the following:

shared report output directory

vs.

base report output directory

vs.

report base output directory

I believe that the last one is logically wrong. I hink it solely refers to the report itself and not the rest. It provides false information.
Now we have only two left. What is important to me is that plugin authors understand that this is not an exclusive directory. Maybe we need to combine them:

shared base report output directory

WDYT?

@kriegaex

Copy link
Copy Markdown

I believe that the last one is logically wrong.

I do not think so, because it dependes on the context and the assumptions under which users read the documentation. My context is obviously different from yours, which is why you think it is logically wrong. Maybe it is also a grammatical question to some degree. I prefer "report base (...) directory" to "base report (...) directory", as the latter seems to be bad English. It is a base directory. What kind of base directory? A report base directory, not a base directory for anything else. Which is why I would order the terms that way.

As for "a lot (of medicine) helps a lot" or combining the terms, making the result an even more unweildy "shared base report output directory" or "shared report base output directory" as the lesser evil, I am not sure if that might not be too subtle for most plugin developers to grasp. In such cases, a little bit of explanation usually helps, why I usually just expand the description, maybe even adding an instructive example. Precise and to the point is good, but sometimes too terse.

I leave the decision up to you, but you asked "WDYT?", so these are my two cents.

@michael-o

Copy link
Copy Markdown
Member Author

@elharo As you are a native English speaker and we don't, would you mind to add your opinion on this?


/**
* Get the base name used to create report's output file(s).
* Get the output name denoting a base location relative to the {@link #getReportOutputDirectory()}

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.

This one is a little hard to describe because what the API does is complicated. On first read, I thought this was just a file name but it's not. But now I read it a third time and maybe it is just a file name? I don't know.

If it is just a file name, then "Returns the name of the output file that will be written in {@link #getReportOutputDirectory()}"

If it can contain subdirectories, then "Returns a path relative to {@link #getReportOutputDirectory()} where the output file will be written."

@kriegaex kriegaex Nov 2, 2023

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@elharo, what it contains (file or subdirectory) depends on whether it is a single or multi page report. Javadoc would be an example for multi page.

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.

OK, so maybe it's a directory name? All of this should be laid out in the docs. What might help is a longish class comment explaining where the report files go and how they're configured.

@michael-o michael-o Nov 2, 2023

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.

@elharo, it is both. A path to a file. I need to rename the API to satisfy this. I could do with a default interface method. The current name is just bad. I am happy to accept any reformulation of the docs which make it better. Should I raise a PR to rename the method and deprecate it? FWIW, it is not necessarily a file name because it is free of a format. The plugin impl does not decide about the format. It is a symbolic name in a virtual FS, so to speak.


/**
* Set a new output directory. Useful for staging.
* Set a new shared base report output directory. This directory may contain output of other

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'm not sure the word "base" adds anything here

output of --> the output of

@kriegaex kriegaex Nov 2, 2023

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@elharo: It adds the notion that not necesarily all reports end up directly in that directory, but that they can also end up in a subdirectory. A base directory is the flipside of the medal regarding the term subdirectory. Of course, without the "base" prefix, that would still hold true, but like I said in an earlier comment: Maximally terse descriptions are not always ideal from a reader's perspective. BTW, the reader inevitably knows way less about the meaning of parameters than the provider. She is also unlikely to read all documentation, but only as little as possible to solve her problem or implement her use case. I.e., she does not have the full context. And even if she does, she is unlikely to remember all of it.

Comment thread src/main/java/org/apache/maven/reporting/MavenReport.java Outdated
Comment thread src/main/java/org/apache/maven/reporting/MavenReport.java Outdated
Comment thread src/main/java/org/apache/maven/reporting/MavenReport.java Outdated
@michael-o
michael-o requested review from elharo and kriegaex November 2, 2023 17:32
@michael-o

Copy link
Copy Markdown
Member Author

@elharo I tried to apply all of your comments. Maybe the method has to renamed to:

String getOutputPath()

since Name is misleading...?

Comment thread src/main/java/org/apache/maven/reporting/MavenReport.java Outdated
Comment thread src/main/java/org/apache/maven/reporting/MavenReport.java Outdated
Comment thread src/main/java/org/apache/maven/reporting/MavenReport.java Outdated
@michael-o
michael-o requested a review from elharo November 2, 2023 18:56
@asfgit
asfgit force-pushed the MSHARED-1326 branch 2 times, most recently from d034eb6 to 60b9d47 Compare November 4, 2023 15:41
@michael-o

Copy link
Copy Markdown
Member Author

Now added #getOutputPath() and deprecate #getOutputName().

@hboutemy hboutemy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good clarification

@michael-o

Copy link
Copy Markdown
Member Author

good clarification

Is the method name change acceptable for you and reasonable?

Comment thread src/main/java/org/apache/maven/reporting/MavenReport.java Outdated

@elharo elharo left a comment

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.

LGTM

@michael-o

Copy link
Copy Markdown
Member Author

@kriegaex, any further objections before I merge this one?

@kriegaex kriegaex left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the improvement. Like boyscouts, you guys in your joint effort left the camp ground behind cleaner than you found it. 🙂

@asfgit asfgit closed this in 65e9ed4 Nov 6, 2023
@asfgit
asfgit merged commit 65e9ed4 into master Nov 6, 2023
@michael-o
michael-o deleted the MSHARED-1326 branch November 6, 2023 20:54
@jira-importer

Copy link
Copy Markdown

Resolve #60

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.

6 participants