Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Github action for site generation to place a direct link to updated section #9274

Closed
romani opened this issue Feb 13, 2021 · 6 comments

Comments

@romani
Copy link
Member

romani commented Feb 13, 2021

Example:
PR modify exact file src/xdocs/config_coding.xml (we need to get a list of changed files in xdocs folder) name/path of them matches name on html
https://github.com/checkstyle/checkstyle/pull/9234/files#diff-cd8c9a8c8d730d1c9a128300a5b0b8302beac605ae7e9d8486e18aae24c44270

in xml we can find <subsection name="Examples" id="HiddenField_Examples"> first section from change.
HiddenField is what we need to parse from this line.

Expected: post like #9234 (comment)
attention to additional link like:
checkstyle-diff-reports.s3.us-east-2.amazonaws.com/HiddenFieldBranch_2021153117/config_coding.html#HiddenField

@strkkk strkkk changed the title Improve Github action for report generation to place a direct link to updated section Improve Github action for site generation to place a direct link to updated section Feb 13, 2021
@aryaniiit002
Copy link
Contributor

aryaniiit002 commented Feb 14, 2021

how do we proceed with this?
i thought of something like we provide a kind of path or name of check or like @romani mentioned above config_coding/HiddenField in PR description, every time we make changes in docs.
if we provide the path then we will get results of direct link to updated section otherwise as usually we are getting.

@strkkk
Copy link
Member

strkkk commented Feb 14, 2021

@aryaniiit002 it will be simpler for contributor to do not write anything in PR description. Especially, it is almost always a new contributors and it can be confusing for them. Also, not all contributors know what section each check belongs to.
So it is better to make github action smart enough to figure this out by itself.

For example, implementation can grep diff between patch branch and master, extract section in xdocs.
After this build an url for specific section based on name of xml file and check name.
If something is found in diff and url is not empty, add it to bot's message.

@aryaniiit002
Copy link
Contributor

aryaniiit002 commented Feb 15, 2021

grep diff between patch branch and master, extract section in xdocs.

i keep searching about it but not getting, i know we can use git diff --stat may be but how do we copy or extract the output and similarly the section in docs?
all i can see of is either echo $Something or saving report in some folder and extracting from it.
can you give me something that might help me?

i need some time i can do this
i am on it

@strkkk
Copy link
Member

strkkk commented Feb 15, 2021

@aryaniiit002 I am not sure what exactly you are asking for. You can extract diff to some file using git diff to some file and after it you can try to extract information that can help to understand what check was affected. It can be some done in other ways, e.g. (stupid version, but possible)

  1. get diff output to some file
  2. get names of modified files from diff file
  3. name of xml file will be page name like config_coding, while name of the check (e.g. HiddedFieldCheck) will be used to understand section (HiddenField)
  4. Build link like https://checkstyle.org/config_coding.html#HiddenField

Or by some other way. The main goal is to get page name and section name

@stoyanK7
Copy link
Contributor

stoyanK7 commented Apr 1, 2023

@romani Found this one while digging for issues. We solved it at #12853. It can be closed.

@romani
Copy link
Member Author

romani commented Apr 1, 2023

Fix is merged

@romani romani closed this as completed Apr 1, 2023
@romani romani added this to the 10.9.4 milestone Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants