Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions .github/workflows/alt-text-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Alt text check"

on:
pull_request:

jobs:
alt-text:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Find markdown images with empty alt text
run: |
set -euo pipefail
echo "Checking Markdown image alt text..."
# Find markdown images with empty alt: ![](path) or ![ ](path)
md_empty_alt=$(git grep -n -E "!\[\s*\]\([^)]*\)" -- 'en/**/*.md' || true)
# Find HTML <img> tags missing an alt attribute
html_missing_alt=$(git grep -n -P "<img\b(?![^>]*\balt=)[^>]*>" -- 'en/**/*.md' || true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

cat >/tmp/alt_text_samples.md <<'EOF'
<img src="a.png">
<img data-alt="decorative" src="b.png">
<IMG SRC="c.png">
<img alt="ok" src="d.png">
EOF

echo "Current pattern:"
grep -nP "<img\b(?![^>]*\balt=)[^>]*>" /tmp/alt_text_samples.md || true

echo "Proposed pattern:"
grep -nP "(?i)<img\b(?![^>]*\salt\s*=)[^>]*>" /tmp/alt_text_samples.md || true

Repository: wso2/docs-apim

Length of output: 195


🏁 Script executed:

cat -n .github/workflows/alt-text-check.yml | head -30

Repository: wso2/docs-apim

Length of output: 1148


🏁 Script executed:

# Verify the exact pattern on line 18
sed -n '18p' .github/workflows/alt-text-check.yml

Repository: wso2/docs-apim

Length of output: 157


🏁 Script executed:

# Test additional edge cases for the proposed pattern
cat >/tmp/alt_text_extended.md <<'EOF'
<img src="a.png">
<img data-alt="decorative" src="b.png">
<IMG SRC="c.png">
<img alt="ok" src="d.png">
<img ALT="ok" src="e.png">
<img alt = "ok" src="f.png">
<img alt="" src="g.png">
<img data-alt="test" alt="ok" src="h.png">
<img src="i.png" data-alt="">
EOF

echo "=== Testing proposed pattern with edge cases ==="
grep -nP "(?i)<img\b(?![^>]*\salt\s*=)[^>]*>" /tmp/alt_text_extended.md || true

Repository: wso2/docs-apim

Length of output: 221


Tighten <img> regex to avoid false negatives.

The current pattern on line 18 misses two cases: HTML <img> tags in uppercase (e.g., <IMG>) due to case-sensitive matching, and attributes like data-alt= are incorrectly accepted as valid alt= attributes due to word-boundary matching.

Proposed fix
-          html_missing_alt=$(git grep -n -P "<img\b(?![^>]*\balt=)[^>]*>" -- 'en/**/*.md' || true)
+          html_missing_alt=$(git grep -n -P "(?i)<img\b(?![^>]*\salt\s*=)[^>]*>" -- 'en/**/*.md' || true)

The updated pattern uses (?i) for case-insensitive matching and \salt\s*= to require whitespace boundaries around alt=, preventing matches against data-alt= or similar attributes.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
html_missing_alt=$(git grep -n -P "<img\b(?![^>]*\balt=)[^>]*>" -- 'en/**/*.md' || true)
html_missing_alt=$(git grep -n -P "(?i)<img\b(?![^>]*\salt\s*=)[^>]*>" -- 'en/**/*.md' || true)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/alt-text-check.yml at line 18, The regex used to populate
html_missing_alt (the git grep pattern "<img\b(?![^>]*\balt=)[^>]*>") is too
permissive and case-sensitive; update the pattern used in html_missing_alt to
use case-insensitive matching and require a whitespace boundary around alt
(e.g., prefix with (?i) and replace \balt= with \salt\s*=) so it catches <IMG>
and avoids matching attributes like data-alt= while keeping the existing
negative lookahead logic.

if [ -n "$md_empty_alt" ] || [ -n "$html_missing_alt" ]; then
echo "Found images missing alt text:" >&2
echo "$md_empty_alt" >&2
echo "$html_missing_alt" >&2
exit 1
fi
echo "All images have alt text (as far as this check can detect)."
2 changes: 1 addition & 1 deletion en/docs/administer/role-based-access-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ below scopes chart to define scopes.
1. Sign in to WSO2 the Admin portal ( `https://<Server Host>:9443+<port offset>/admin` ) as the super admin or tenant admin
2. Click `Scope Assignments` in the left sidebar and click on `Add scope mappings` .
3. In the `Provide role name` text input give the role name which was previously created in step 1 and then click `next`.
4. In the `Select Permissions` menu, select the `Custom scope assignments` option. And select the scopes that you want to assign for the newly created role. You can refer the following table when assigning the scopes. For example, If the admin wants the newly created user to access the key managers settings in the admin portal he can assign `apim:keymanagers_manage`, `apim:tenantInfo`, and `apim:admin_settings`.
4. In the `Select Permissions` menu, select the `Custom scope assignments` option. And select the scopes that you want to assign for the newly created role. You can refer to the following table when assigning the scopes. For example, If the admin wants the newly created user to access the key managers settings in the admin portal he can assign `apim:keymanagers_manage`, `apim:tenantInfo`, and `apim:admin_settings`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Tighten wording for readability in this instruction step.

This sentence is grammatically awkward in two places ("And select...", "For example, If..."). Please rewrite it as one clear flow to improve documentation quality.

Suggested rewrite
-4. In the `Select Permissions` menu, select the `Custom scope assignments` option. And select the scopes that you want to assign for the newly created role. You can refer to the following table when assigning the scopes. For example, If the admin wants the newly created user to access the key managers settings in the admin portal he can assign `apim:keymanagers_manage`, `apim:tenantInfo`, and `apim:admin_settings`.
+4. In the `Select Permissions` menu, select `Custom scope assignments`, then choose the scopes to assign to the newly created role. Refer to the following table when assigning scopes. For example, if the admin wants the newly created user to access Key Manager settings in the Admin Portal, assign `apim:keymanagers_manage`, `apim:tenantInfo`, and `apim:admin_settings`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
4. In the `Select Permissions` menu, select the `Custom scope assignments` option. And select the scopes that you want to assign for the newly created role. You can refer to the following table when assigning the scopes. For example, If the admin wants the newly created user to access the key managers settings in the admin portal he can assign `apim:keymanagers_manage`, `apim:tenantInfo`, and `apim:admin_settings`.
4. In the `Select Permissions` menu, select `Custom scope assignments`, then choose the scopes to assign to the newly created role. Refer to the following table when assigning scopes. For example, if the admin wants the newly created user to access Key Manager settings in the Admin Portal, assign `apim:keymanagers_manage`, `apim:tenantInfo`, and `apim:admin_settings`.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/docs/administer/role-based-access-control.md` at line 24, Rewrite the
sentence in step 4 to produce a single clear instruction: replace the two
clauses "And select the scopes..." and "For example, If..." with one flowing
sentence that instructs the user to choose "Custom scope assignments" in the
"Select Permissions" menu and then pick the desired scopes, and include the
example scopes `apim:keymanagers_manage`, `apim:tenantInfo`, and
`apim:admin_settings` as a concrete example; ensure "If" is lowercased and
remove the leading "And" so the sentence reads smoothly.


[![Add admin Scope Mapping For Role Based Access Control]({{base_path}}/assets/img/administer/add-admin-scope-mapping-role-based-access.png)]({{base_path}}/assets/img/administer/add-admin-scope-mapping-role-based-access.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The Control Plane serves as the central intelligence hub for WSO2 Kubernetes Gateway, orchestrating the entirety of the API ecosystem. It encompasses critical functionalities such as API management, administrative operations, and the API marketplace. Structurally, it comprises four principal components: the Back Office, Dev Portal, Admin Portal, and APIM-APK Agent. These components cater to diverse user roles, ranging from API product managers to consumers and administrative personnel. Within the Control Plane, users configure, oversee, and track the performance of APIs, ensuring seamless management and optimization of the API landscape.

For the Kubernetes Gateway Control Plane, we are going to use same WSO2 API Control Plane. The WSO2 API control plane is a set of components that are responsible for managing and monitoring APIs.
For the Kubernetes Gateway Control Plane, we are going to use the same WSO2 API Control Plane. The WSO2 API control plane is a set of components that are responsible for managing and monitoring APIs.
Kubernetes Gateway only supports REST API and GraphQL API creation for now.

## Architecture
Expand Down Expand Up @@ -32,4 +32,4 @@ The APIM APK Agent is a component that connects the WSO2 API Control Plane with

## Next Steps

You can refer the [Quick Start Guide](https://apk.docs.wso2.com/en/latest/get-started/quick-start-guide-with-cp/) with regards to trying out API Control Plane with Kubernetes Gateway using APIM-APK Agent.
You can refer to the [Quick Start Guide](https://apk.docs.wso2.com/en/latest/get-started/quick-start-guide-with-cp/) with regards to trying out API Control Plane with Kubernetes Gateway using APIM-APK Agent.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use “with regard to” (or simplify phrasing) for grammatical correctness.

with regards to trying out is awkward. Consider:
You can refer to the [Quick Start Guide](https://apk.docs.wso2.com/en/latest/get-started/quick-start-guide-with-cp/) for trying out API Control Plane with Kubernetes Gateway using APIM-APK Agent.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@en/docs/install-and-setup/setup/distributed-deployment/configuring-apim-as-a-gateway.md`
at line 35, The phrase "with regards to trying out" in the sentence "You can
refer to the [Quick Start
Guide](https://apk.docs.wso2.com/en/latest/get-started/quick-start-guide-with-cp/)
with regards to trying out API Control Plane with Kubernetes Gateway using
APIM-APK Agent." is grammatically awkward; replace it with a correct and simpler
wording such as "for trying out" or "to try out" so the sentence reads e.g. "You
can refer to the Quick Start Guide for trying out API Control Plane with
Kubernetes Gateway using APIM-APK Agent." Ensure the linked text remains
unchanged.