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

Generate action documentation and automatically publish to wiki #528

Merged
merged 48 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e7e33dc
can create wiki folder structure
DnlLrssn Feb 13, 2025
e9f9c8c
can generate action files
DnlLrssn Feb 14, 2025
3dc0c48
generate actions folder and sidebar only
DnlLrssn Feb 17, 2025
de8142a
fix some linter issues
DnlLrssn Feb 17, 2025
9acf48b
Merge branch 'master' into documentation/1584-actions-to-wiki
DnlLrssn Feb 17, 2025
41aafcf
can generate config except schedulers
DnlLrssn Feb 17, 2025
c9c632b
improved config section
DnlLrssn Feb 17, 2025
4320564
expander for config example
DnlLrssn Feb 17, 2025
0943da3
no longer delete sidebar
DnlLrssn Feb 17, 2025
31bd9e7
make sure wiki groups order same order + remove expander title
DnlLrssn Feb 18, 2025
b397cf8
remove non developer documentation from repo
DnlLrssn Feb 18, 2025
d6b811d
move session variable section
DnlLrssn Feb 19, 2025
d1d8b49
hack to fix link in session variables section
DnlLrssn Feb 19, 2025
a9b6e72
add wiki as submodule and add entry to readme
DnlLrssn Feb 19, 2025
0cf4671
update readme
DnlLrssn Feb 19, 2025
0413dfb
add make command to generate wiki
DnlLrssn Feb 19, 2025
0ebb461
give error generation wiki if ungrouped action exists
DnlLrssn Feb 19, 2025
3be2e5c
remove generation of settingup.json via go generate
DnlLrssn Feb 19, 2025
d5151fd
add initial workflow
DnlLrssn Feb 19, 2025
4d54962
trigger action on push to this branch
DnlLrssn Feb 19, 2025
e2b9fb7
try add initwiki
DnlLrssn Feb 19, 2025
bbc2458
try turn on submodules
DnlLrssn Feb 19, 2025
f90fb51
remove initwiki command
DnlLrssn Feb 19, 2025
da314e4
add genwiki command
DnlLrssn Feb 19, 2025
d9d4680
add change detection
DnlLrssn Feb 19, 2025
41f05c0
add publish to github action
DnlLrssn Feb 20, 2025
0bf8e9b
small fix to test wiki publish
DnlLrssn Feb 20, 2025
eb9ea9b
update workflow
DnlLrssn Feb 20, 2025
946df17
try new if for publish
DnlLrssn Feb 20, 2025
4e99f75
try set user
DnlLrssn Feb 20, 2025
cdd7db1
try checkout master
DnlLrssn Feb 20, 2025
3a977b4
better submodule handling
DnlLrssn Feb 20, 2025
d01aca4
add auto update wiki entry to branch
DnlLrssn Feb 20, 2025
f3ce6ff
Github action automatically added generated documentation
Feb 20, 2025
bdd087b
publish wiki on master push
DnlLrssn Feb 20, 2025
dad152a
add check doc gen on PR
DnlLrssn Feb 20, 2025
c9f1424
add action change to be generated on push to master + fail for doc ge…
DnlLrssn Feb 20, 2025
dffae24
yaml sucks
DnlLrssn Feb 20, 2025
0d06b46
fix check doc action
DnlLrssn Feb 20, 2025
7175d1d
fix check doc action
DnlLrssn Feb 20, 2025
27f06b6
verify doccheck again positive
DnlLrssn Feb 20, 2025
84c4db6
Merge branch 'master' into documentation/1584-actions-to-wiki
DnlLrssn Feb 20, 2025
ffe17d1
fix typo
DnlLrssn Feb 21, 2025
09aa6a9
use newer action versions
DnlLrssn Feb 21, 2025
99da339
remove extra var definition from Makefile
DnlLrssn Feb 21, 2025
032633b
fix group sorting + footer
DnlLrssn Feb 24, 2025
b285a01
home and load scenario link naming
DnlLrssn Feb 24, 2025
8f2963b
small change in action description to test wiki publish on merge to m…
DnlLrssn Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/check-generate-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Documentation check

on:
workflow_dispatch:
pull_request:
branches:
- master

jobs:
checkdocs:
name: Verify generated
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Set up GO
uses: actions/setup-go@v3
with:
go-version: 1.23

- name: Cache go modules
id: cache-go
uses: actions/cache@v3
env:
cache-name: dependency-cache-1.23
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Generate docs
run: |
go generate

- name: Verify nothing to generate
run: |
if [[ "$(git diff --name-only -- generatedocs/generated/documentation.go)" != "" ]]; then
echo "documentation not generated"
exit 1
fi
79 changes: 79 additions & 0 deletions .github/workflows/publishwiki.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Publish wiki

on:
workflow_dispatch:
push:
branches:
- "master"
jobs:
generatewiki:
name: Generate WIKI
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Set up GO
uses: actions/setup-go@v3
with:
go-version: 1.23

- name: Cache go modules
id: cache-go
uses: actions/cache@v3
env:
cache-name: dependency-cache-1.23
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Generate wiki
run: |
make genwiki PARAM=--verbose

- name: Publish if any changes
env:
GIT_USER_EMAIL: ${{ secrets.PERBOT_EMAIL }}
GIT_USER_NAME: ${{ secrets.PERBOT_USERNAME }}
run: |
git status
cd gopherciser.wiki
if [[ "$(git diff --name-only)" != "" ]]; then
git status
echo "publishing wiki"
set -e
git config user.email "$GIT_USER_EMAIL"
git config user.name "$GIT_USER_NAME"
git commit -a -m "Github action automatically generated wiki"
git push
else
echo "no changes skipping publish"
fi

- name: Update submodule and generated go file in branch
env:
GIT_USER_EMAIL: ${{ secrets.PERBOT_EMAIL }}
GIT_USER_NAME: ${{ secrets.PERBOT_USERNAME }}
run: |
pwd
git status
if [[ "$(git diff --name-only)" != "" ]]; then
echo "add generated documentation and wiki sha to branch"
set -e
git config user.email "$GIT_USER_EMAIL"
git config user.name "$GIT_USER_NAME"
git add generatedocs/generated/documentation.go
git add gopherciser.wiki
git status
git commit -m "Github action automatically added generated documentation"
git push
else
echo "nothing to add"
fi
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "gopherciser.wiki"]
path = gopherciser.wiki
url = [email protected]:qlik-oss/gopherciser.wiki.git
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ifeq ($(UNAME_S),Darwin)
OSFLAG += ./$(BIN)/$(BIN_NAME)_osx
endif
endif
PARAM ?=

.PHONY: clean build unit-test-cover unit-test-cover-ext codeclimate lint test alltests

Expand Down Expand Up @@ -63,3 +64,14 @@ alltests:

# Run quickbuild test and linting. Good to run e.g. before pushing to remote
verify: quickbuild test lint-min

# init submodule and get latest version
initwiki:
git submodule update --init --recursive --remote
git submodule foreach --recursive git checkout master

# generate config and action documenation
genwiki: initwiki
set -e
go generate
go run ./generatedocs/cmd/generatemarkdown $(PARAM) --wiki ./gopherciser.wiki
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,29 @@ Gopherciser is used for load testing (that is, stress testing and performance me

Gopherciser can run standalone, but is also included in the Qlik Sense Enterprise Scalability Tools (QSEST), which are available for download [here](https://community.qlik.com/t5/Qlik-Scalability/Qlik-Sense-Enterprise-Scalability-Tools/gpm-p/1579916).

More information on Gopherciser is available here:
For more information on how to perform load testing with Gopherciser see the [wiki](https://github.com/qlik-oss/gopherciser/wiki/introduction), this readme documents building and development of gopherciser.

* [Load testing - an introduction](./docs/README.md)
* [Setting up load scenarios](./docs/settingup.md)
* [Architecture and code structure](./architecture.md)
## Cloning repo

This repo contains the wiki as a submodule, to clone sub modules when cloning the project

```bash
git clone --recurse-submodules [email protected]:qlik-oss/gopherciser.wiki.git
```

If repo was cloned manually, the wiki submodule can be checked out using

```bash
git submodule update --init --recursive
```

Updating submodule to version defined by current branch commit:

```bash
git submodule update
```

**Note** the submodule will by default be in it's `master` branch. Any changes done and pushed in the submodule master branch will instantly update the wiki (i.e. don't make changes intended for a PR directly here).

## Building Gopherciser

Expand Down Expand Up @@ -40,9 +58,17 @@ If you use Git Bash, but do not have `make.exe` installed, do the following to i
#### Building the documentation

The documentation can be generated from json with:

```bash
go generate
```

To generate wiki run

```bash
make genwiki
```

For more information, see [Generating Gopherciser documentation](./generatedocs/README.md).

### Build commands
Expand Down
Loading