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

Introduce workflow for doc #172

Open
sunglim opened this issue Jul 10, 2024 · 5 comments
Open

Introduce workflow for doc #172

sunglim opened this issue Jul 10, 2024 · 5 comments

Comments

@sunglim
Copy link
Contributor

sunglim commented Jul 10, 2024

Is your feature request related to a problem? Please describe.
As we're updating docs manually, docs can be easily outdated.

Describe the solution you'd like
Introduce a github workflow for docs. I think there is two options.
option#1. When PR is created, a workflow is triggered, if doc in the PR is not updated, the bot will fail.
option#2. When a new PR is merged, a workflow is triggered to create a PR with doc updated.

Describe alternatives you've considered
N/A

Additional context
Discussed in #171 (comment)

@cinar
Copy link
Owner

cinar commented Jul 10, 2024

I wonder, given that the repo requires signed commits, would it be better to handle this as part of the Git pre-commit hook? This will ensure that it gets executed before it leaves the contributor's machine. It is also easy to have it invoke the existing ./pre-commit.sh. what do you think?

@sunglim
Copy link
Contributor Author

sunglim commented Jul 10, 2024

Thank you for asking my opinion.

Yes. I agree that Git pre-commit hook is a good(better for now) solution.

This will ensure that it gets executed before it leaves the contributor's machine.

I have a small concern. Contributors can intentionally or unintentionally skip pre-commit hook installation. So, it's not 100% guaranteed. I think later on when this repository becomes more popular, we can visit this thread again and consider using workflow.

Please feel free to close this issue.

@cinar
Copy link
Owner

cinar commented Jul 10, 2024

You gave a great point. I wonder if we need to combine both. Git hook to do it with the commit, and a GitHub workflow to perhaps block the pull request?

@sunglim
Copy link
Contributor Author

sunglim commented Jul 10, 2024

My two cents is

Ideally, we need to use both. Run pre-commit to executes locally & quickly before committing. Then workflow is triggered when a PR is created, it will block if doc is not updated.

I ran sh pre-commit.sh on my mac. it takes 20s. If we introduce git pre-commit hook, I think we should reduce the running time. Otherwise, it will be annoying as it is called every commits.

$ time sh pre-commit.sh
/Users/i333043/go/bin/revive
...
real	0m20.206s
user	0m9.189s
sys	0m9.714s

PS.
To be honest, my preference is having only github workflow to block PR. It is a simple.

@cinar
Copy link
Owner

cinar commented Jul 10, 2024

To be honest, my preference is having only github workflow to block PR. It is a simple.

Let's do it. I agree with you that it is simpler. We can always do the Git hook when necessary.

Thank you so much again for your contribution!

cinar pushed a commit that referenced this issue Jul 11, 2024
# Describe Request

This PR introduces `.gomarkdoc.yml` which includes default configuration
of gomarkdoc.
This way, we can reuse the same configuration across multiple
invocations such as `pre-commit.sh` and github workflow.
Also, docs are updated by executing pre-commit.sh.

Fixed # partially #172

# Change Type

Docs.
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

No branches or pull requests

2 participants