Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix_widget_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jnumainville committed Sep 3, 2024
2 parents e2aceb9 + ae0a54f commit 65b5bd0
Show file tree
Hide file tree
Showing 109 changed files with 7,213 additions and 17,979 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/build-main-docs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
name: Build Main Docs
name: Build Docs

on:
workflow_dispatch:
inputs:
package:
description: 'Name of the package to build docs for.'
required: true
type: choice
options:
- 'plotly-express'
- 'ui'
version:
description: 'Version of the package to build docs for. This only affects where the docs are synced and not the actual docs built so in most cases this should be "main".'
required: true
type: string
default: 'main'
event_name:
description: 'Event name to determine if the docs should be synced. Keep this as "push" to sync the docs.'
required: true
type: choice
default: 'push'
options:
- 'push'
- 'test'
workflow_call:
inputs:
package:
description: The plugin to publish the docs for
required: true
type: string
version:
description: The version of the plugin to publish the docs for
type: string
default: 'main'
event_name:
description: The event name that triggered the workflow
required: true
Expand Down Expand Up @@ -40,5 +66,5 @@ jobs:
secrets: inherit
with:
package: ${{ inputs.package }}
version: 'main'
version: ${{ inputs.version }}
event_name: ${{ inputs.event_name }}
15 changes: 7 additions & 8 deletions .github/workflows/make-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ jobs:
cat << EOF > $HOME/.config/rclone/rclone.conf
[plugindocs]
type = s3
provider = Cloudflare
access_key_id = ${{ secrets.DOCS_CLOUDFLARE_ACCESS_KEY_ID }}
secret_access_key = ${{ secrets.DOCS_CLOUDFLARE_SECRET_ACCESS_KEY }}
endpoint = ${{ secrets.DOCS_CLOUDFLARE_ENDPOINT }}
no_check_bucket = true
acl = private
type = google cloud storage
service_account_file = $HOME/credentials.json
project_number = ${{ secrets.DOCS_GOOGLE_CLOUD_PROJECT_NUMBER }}
bucket_policy_only = true
EOF
echo ${{ secrets.DOCS_GOOGLE_CLOUD_CREDENTIALS }} | base64 -d > $HOME/credentials.json
- name: Sync docs
if: inputs.event_name == 'push'
run: rclone sync plugins/${{ inputs.package }}/docs/build/markdown/ plugindocs:website/deephaven/deephaven-plugins/${{ inputs.package }}/${{ inputs.version }}/
run: rclone sync plugins/${{ inputs.package }}/docs/build/markdown/ plugindocs:${{ secrets.DOCS_GOOGLE_CLOUD_BUCKET }}/deephaven/deephaven-plugins/${{ inputs.package }}/${{ inputs.version }}/
51 changes: 51 additions & 0 deletions .github/workflows/request-docs-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Add docs reviewers'

on:
# Needs to be pull_request_target for pull-request write permission
pull_request_target:
paths:
- '**/docs/**/*.md'
types:
- opened
- synchronize
- reopened
- ready_for_review

jobs:
add-docs-reviewers:
if: github.event.pull_request.draft == false
permissions:
pull-requests: write
runs-on: ubuntu-22.04

steps:
- name: Add docs reviewers
uses: actions/github-script@v7
with:
script: |
const reviewer = 'margaretkennedy';
const pendingReviewers = await github.rest.pulls.listRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
const isPending = pendingReviewers.data?.users?.some(({ login }) => login === reviewer);
const reviews = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
const isReviewed = reviews.data?.some(review => review.user.login === reviewer);
if (!isPending && !isReviewed) {
github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: [reviewer]
});
}
2 changes: 1 addition & 1 deletion cog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ci = { changelog_title = "", omit_from_changelog = true }

[changelog]
path = "CHANGELOG.md"
template = "remote"
template = "deephaven-changelog-template"
remote = "github.com"
repository = "deephaven-plugins"
owner = "deephaven"
Expand Down
54 changes: 54 additions & 0 deletions deephaven-changelog-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{# Tera templates are used to generate the changelog content -#}
{# https://keats.github.io/tera/docs/ -#}
{# Based on Cocogittos remote template, but adds breaking changes: https://github.com/cocogitto/cocogitto/blob/main/src/conventional/changelog/template/remote -#}
{# First display all the breaking changes -#}
{% set breaking_commits = commits | filter(attribute="breaking_change", value=true) -%}
{% if breaking_commits | length > 0 -%}
#### ⚠ Breaking Changes

{% for commit in breaking_commits -%}
{% set commit_link = repository_url ~ "/commit/" ~ commit.id -%}
{% set shorthand = commit.id | truncate(length=7, end="") -%}
{% for footer in commit.footer | filter(attribute="token", value="BREAKING CHANGE") -%}
- {{ footer.content }} - ([{{shorthand}}]({{ commit_link }}))
{% endfor -%}
{% endfor -%}
{% endif %}

{# Now group the rest of the commits and display them -#}
{% set typed_commit_map = commits | group_by(attribute="type") -%}
{% set type_order = ["Features", "Bug Fixes", "Performance Improvements", "Miscellaneous Chores", "Documentation", "Refactoring", "Build system", "Style"] -%}
{% for type in type_order -%}
{% if typed_commit_map[type] -%}
#### {{ type | upper_first }}
{% for scope, scoped_commits in typed_commit_map[type] | group_by(attribute="scope") -%}

{% for commit in scoped_commits | sort(attribute="scope") -%}
{% if commit.author and repository_url -%}
{% set author = "@" ~ commit.author -%}
{% set author_link = platform ~ "/" ~ commit.author -%}
{% set author = "[" ~ author ~ "](" ~ author_link ~ ")" -%}
{% else -%}
{% set author = commit.signature -%}
{% endif -%}
{% set commit_link = repository_url ~ "/commit/" ~ commit.id -%}
{% set shorthand = commit.id | truncate(length=7, end="") -%}
- **({{ scope }})** {{ commit.summary }} - ([{{shorthand}}]({{ commit_link }})) - {{ author }}
{% endfor -%}

{% endfor -%}

{% for commit in typed_commit_map[type] | unscoped -%}
{% if commit.author and repository_url -%}
{% set author = "@" ~ commit.author -%}
{% set author_link = platform ~ "/" ~ commit.author -%}
{% set author = "[" ~ author ~ "](" ~ author_link ~ ")" -%}
{% else -%}
{% set author = commit.signature -%}
{% endif -%}
{% set commit_link = repository_url ~ "/commit/" ~ commit.id -%}
{% set shorthand = commit.id | truncate(length=7, end="") -%}
- {{ commit.summary }} - ([{{shorthand}}]({{ commit_link }})) - {{ author }}
{% endfor -%}
{% endif %}
{% endfor -%}
Loading

0 comments on commit 65b5bd0

Please sign in to comment.