Skip to content

fix(store): hide packages by org/name, exclude them from the sitemap and return not found on their pages - #62

Merged
daneshk merged 3 commits into
wso2:mainfrom
Akil-Dikshan:fix/hidden-packages-org-aware-sitemap
Oct 6, 2026
Merged

daneshk merged 3 commits into
wso2:mainfrom
Akil-Dikshan:fix/hidden-packages-org-aware-sitemap

Conversation

@Akil-Dikshan

@Akil-Dikshan Akil-Dikshan commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Hidden packages were only filtered from the listing and search. This makes the hidden list apply
everywhere, and lets entries target one organization.

  • HIDDEN_PACKAGES entries can now be a bare name (every org) or org/name (one org).
  • Hidden packages are excluded from the generated sitemap (836 -> 755 URLs).
  • Hidden packages' detail pages show a "Connector not found" view instead of rendering.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition/update

Related Issue(s)

Relates to wso2/product-integrator#2639 (items 2 and 4)

Changes Made

  • The list moved to hidden-packages.json (same 82 entries, unchanged) because scripts/generate-sitemap.js
    is plain Node and cannot import TypeScript. HIDDEN_PACKAGES is still a mutable Set built from it.
  • New isHiddenPackage(pkg) matches a bare name or org/name. rest-client.ts uses it at all three places
    that used HIDDEN_PACKAGES.has(pkg.name). organization is added to the BallerinaPackage type; the API
    already returns it.
  • generate-sitemap.js reads the same JSON and skips hidden packages. Added a require.main guard and
    exports so it can be unit-tested; behavior as a plain script is unchanged.
  • ConnectorDetailPage.tsx: for a hidden package it skips all fetching and shows "Connector not found"
    with a "Back to store" button (no Retry).
  • hidden-packages.md describes the list format.
  • Tests: isHiddenPackage, a dual-org case in rest-client.test.ts, sitemap exclusion, and a new
    ConnectorDetailPage.test.tsx.

np still hides both ballerina/np and ballerinax/np, as agreed. Use an org/np entry to hide only one.

Testing Performed

Test Environment

  • Browser(s): Chrome
  • OS: Ubuntu
  • Node Version: 18.19.1

Test Cases

  • Unit tests pass (npm test)

  • Integration tests pass (if applicable)

  • Manual testing completed

  • Tested on mobile devices

  • Tested on desktop browsers

  • 8 suites, 114 tests pass on this branch.

  • node scripts/generate-sitemap.js against the live Ballerina Central API: 755 URLs (836 before), with no
    ballerina/sql or np in the output. npm run build also compiles with the prebuild step.

  • Browser: /connector/ballerina/sql/latest shows "Connector not found"; /connector/ballerinax/kafka/latest
    loads normally.

  • Mutation check: a name-only isHiddenPackage makes the org tests fail.

Screenshots

Before

/connector/ballerina/sql/latest renders a full detail page.

After

<attach the "Connector not found" screenshot>

Code Quality Checklist

  • Code follows project style guidelines (npm run lint passes)
  • Code is properly formatted (npm run format:check passes)
  • TypeScript compilation succeeds (npx tsc --noEmit)
  • No console.log statements (except console.warn/console.error)
  • Comments added for complex logic
  • Self-review completed

Documentation

  • README updated (if needed)
  • CHANGELOG updated (if needed)
  • Documentation added/updated (if needed)
  • JSDoc comments added for new functions

Performance Impact

  • No performance impact
  • Performance improved
  • Performance degraded (explain below)

Details:

Breaking Changes

  • No breaking changes
  • Breaking changes (describe below)

Details:

Additional Notes

  • The not-found page is client-side. The host rewrites every URL to index.html (_redirects), so the HTTP
    status is still 200. A real 404 would need a hosting change.
  • Existing latent issue, not changed here: the full-fetch path dedupes by name-version and ignores the org,
    so if two orgs ever publish the same name at the same version one would be dropped before the hidden check.
    It doesn't affect today's data.
  • Danesh confirmed hidden detail pages should return not found.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be773b5e-54e9-4fca-9a30-3d55f57ce75a
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Akil-Dikshan Akil-Dikshan changed the title Fix/hidden packages org aware sitemap fix(store): hide packages by org/name, exclude them from the sitemap and return not found on their pages Oct 5, 2026
@daneshk
daneshk merged commit 3db585d into wso2:main Oct 6, 2026
8 checks passed
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.

2 participants