Skip to content

[DevPortal] Fixed failing test cases#2752

Merged
lasanthaS merged 1 commit into
wso2:mainfrom
lasanthaS:main
Jul 19, 2026
Merged

[DevPortal] Fixed failing test cases#2752
lasanthaS merged 1 commit into
wso2:mainfrom
lasanthaS:main

Conversation

@lasanthaS

Copy link
Copy Markdown
Contributor

Purpose

$subject

Security checks

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The integration test harness now provisions host-mounted TLS certificates, supports templated server and database settings, serializes REST API tests, and corrects Cypress API routing. View deletion now blocks views with API workflows and transactionally removes dependent records.

Changes

Integration test harness

Layer / File(s) Summary
TLS-backed test environment
portals/developer-portal/it/Makefile, portals/developer-portal/it/docker-compose.test*.yaml, portals/developer-portal/it/.gitignore, portals/developer-portal/.dockerignore
Test targets generate or reuse host certificates, mount them into platform-api, upgrade its image, and remove the named certificate volume.
Configurable and serialized test execution
portals/developer-portal/it/test-config.toml, portals/developer-portal/it/rest-api/jest.config.js, portals/developer-portal/it/ui/cypress/support/e2e.js
Test configuration adds server and database templates, REST API tests use one worker and a longer timeout, and Cypress uses the API router base path.

View deletion safety

Layer / File(s) Summary
Workflow-aware deletion guard
portals/developer-portal/src/services/apiMetadataService.js, portals/developer-portal/src/utils/constants.js
View deletion checks for associated API workflows and returns HTTP 409 with ERR_WORKFLOW_EXIST when any exist.
Transactional dependent cleanup
portals/developer-portal/src/dao/viewDao.js
Deletion now loads the view, handles missing views, removes related ViewLabels and OrgContent, and deletes all records within the supplied transaction.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: renuka-fernando, malinthaprasan, ashera96

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only fills Purpose and Security checks; it omits required Goals, Approach, tests, docs, related PRs, and environment sections. Add the missing template sections with the problem statement, solution approach, user stories, test coverage, docs impact, related PRs, and test environment details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: fixing failing DevPortal test cases.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
portals/developer-portal/it/Makefile (1)

19-20: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove all from .PHONY or define it.

The all target is declared in the .PHONY list but is not defined in the Makefile. Running make all will result in a "No rule to make target" error. Consider removing it from .PHONY or defining it (e.g., all: test test-postgres).

🧹 Proposed fix
-.PHONY: all test test-postgres test-rest-api test-rest-api-postgres open clean deps ensure-test-tag ensure-certs
+.PHONY: test test-postgres test-rest-api test-rest-api-postgres open clean deps ensure-test-tag ensure-certs
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@portals/developer-portal/it/Makefile` around lines 19 - 20, Remove the
undefined all target from the .PHONY declaration in the Makefile, or define an
all target that aggregates the intended test targets; keep the remaining phony
targets unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@portals/developer-portal/src/dao/viewDao.js`:
- Around line 80-107: Update the caller of viewDao.delete in
apiMetadataService.js so it passes the surrounding sequelize transaction as the
third argument, matching deleteView(orgId, handle, t). Make the transaction
parameter required in the DAO if deleteView is intended to be transaction-only,
and ensure ViewLabels.destroy, OrgContent.destroy, and View.destroy all use that
same transaction.

---

Nitpick comments:
In `@portals/developer-portal/it/Makefile`:
- Around line 19-20: Remove the undefined all target from the .PHONY declaration
in the Makefile, or define an all target that aggregates the intended test
targets; keep the remaining phony targets unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 18c8ae79-2e3b-4fa6-93ee-b100f28fd98f

📥 Commits

Reviewing files that changed from the base of the PR and between 5f8e7f8 and 7007017.

📒 Files selected for processing (11)
  • portals/developer-portal/.dockerignore
  • portals/developer-portal/it/.gitignore
  • portals/developer-portal/it/Makefile
  • portals/developer-portal/it/docker-compose.test.postgres.yaml
  • portals/developer-portal/it/docker-compose.test.yaml
  • portals/developer-portal/it/rest-api/jest.config.js
  • portals/developer-portal/it/test-config.toml
  • portals/developer-portal/it/ui/cypress/support/e2e.js
  • portals/developer-portal/src/dao/viewDao.js
  • portals/developer-portal/src/services/apiMetadataService.js
  • portals/developer-portal/src/utils/constants.js

Comment thread portals/developer-portal/src/dao/viewDao.js
@lasanthaS
lasanthaS merged commit e67794b into wso2:main Jul 19, 2026
8 of 9 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