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

feat: support document generation for workflows #523

Merged
merged 44 commits into from
Mar 6, 2024

Conversation

larmitage-bjss
Copy link
Contributor

@larmitage-bjss larmitage-bjss commented Feb 13, 2024

Adds functionality to be able to generate documentation for workflows as well as actions

  • Workflow documentation includes header, inputs, outputs, and useage (assuming a reuseable workflow)
  • Duplicated all action tests and amended them for workflows
  • Did some refactoring of the formatting functions in action-docs.ts to make it more readable and less dependent on the column order for inputs/outputs

Notes:

  • to improve on this I think it would be nice to be able to generate documentation of the on section, but as there are a lot of trigger events I think it would be best to do this separately (I will open an issue for this)

@larmitage-bjss larmitage-bjss marked this pull request as draft February 13, 2024 13:49
@larmitage-bjss
Copy link
Contributor Author

Sorry meant to open this in my fork repo, please ignore for now, I'm still working on it

@npalm
Copy link
Owner

npalm commented Feb 13, 2024

Sorry meant to open this in my fork repo, please ignore for now, I'm still working on it

I love when people open PR asap, this is a great way to share there is work being done on feature. The PR is in draft so all good!

@larmitage-bjss
Copy link
Contributor Author

I love when people open PR asap, this is a great way to share there is work being done on feature. The PR is in draft so all good!

Thanks, it's so easy to do especially if you're not used to working with forks as you're not expecting the target branch to default to the original repo! 🙈
Thanks for taking a look at my other PRs. Hoping to get something in today (UK time) for the workflow functionality

@larmitage-bjss
Copy link
Contributor Author

@npalm To let you know, I'm having some issues with megalinter. I've tried running it locally but there's an issue with @types/glob

It's the same as this issue here: isaacs/rimraf#264

You shouldn't need those @types packages if rimraf glob and minimatch are all at latest. They're written in typescript.

It's because mega-linter-runner@^7.9.0 requires glob-promise which requires @types/glob so not sure that's an easy fix

I can see the megalinter workflow isn't passing on main so I assume that's still in progress and I'll ignore it for now

@npalm npalm changed the title Gh 240 support workflows feat: support document generation for workflows Mar 4, 2024
@npalm
Copy link
Owner

npalm commented Mar 4, 2024

@larmitage-bjss great PR, just had a bit more time to have a look. I would say in general fine. Would you have time to address my last comment. As well re-base with main.

@larmitage-bjss
Copy link
Contributor Author

@npalm thanks very much, sorry I haven't updated in a while, I've been busy but should have some time to finish this off tomorrow

@larmitage-bjss
Copy link
Contributor Author

The html comment tags are having an attribute action. With the support for workflows this can become confusing. I think we should introduce another breaking change and rename it to source instead of action. In case you see a change to keep it backwards compatible that would be much better. Let me know if you need nay help here.
The cli has the option -a for action file. This could now by also a workflow. Would suggest to introdcue -s and --source that is doing the same. But keep -a for backwards compatibility (mark it depcrecated).

I have also done this, keeping it backwards compatible for the readmes

@npalm actually I think this is ready for re-review now, just let me know about this comment

@@ -55,7 +55,9 @@
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
"@typescript-eslint/unbound-method": "error",
Copy link
Owner

Choose a reason for hiding this comment

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

Do you recall which lines are triggering this issue. Would prefer either fix the error, or at an ignore on the line. Not global.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue was with adding enums causing an error already declared in the upper scope
Adding those two lines was as suggested here:
typescript-eslint/typescript-eslint#2466

@npalm npalm changed the title feat: support document generation for workflows feat!: support document generation for workflows Mar 5, 2024
README.md Show resolved Hide resolved
@npalm npalm changed the title feat!: support document generation for workflows feat! support document generation for workflows Mar 5, 2024
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@npalm
Copy link
Owner

npalm commented Mar 5, 2024

@larmitage-bjss checked the PR again. Looks good, some minor left overs.

@npalm npalm changed the title feat! support document generation for workflows feat support document generation for workflows Mar 5, 2024
larmitage-bjss and others added 2 commits March 6, 2024 10:07
Co-authored-by: Niek Palm <npalm@users.noreply.github.com>
@npalm npalm changed the title feat support document generation for workflows feat: support document generation for workflows Mar 6, 2024
Copy link
Owner

@npalm npalm left a comment

Choose a reason for hiding this comment

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

@larmitage-bjss wow what a great job.

@npalm
Copy link
Owner

npalm commented Mar 6, 2024

close #240

@npalm npalm merged commit f043f7f into npalm:main Mar 6, 2024
4 of 5 checks passed
@larmitage-bjss larmitage-bjss deleted the GH-240-support-workflows branch March 25, 2024 09:19
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.

None yet

2 participants