Skip to content

Conversation

@lukaszgryglicki
Copy link
Member

@lukaszgryglicki lukaszgryglicki commented Aug 12, 2025

cc @ahmedomosanya @mlehotskylf @ah-med

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when loading user profiles, project details, active signature status, and Gerrit project info, reducing errors and ensuring up-to-date data.
  • Chores
    • Updated backend service integrations to use stable endpoints for user, project, and signature data.

Signed-off-by: Lukasz Gryglicki <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Aug 12, 2025

Walkthrough

The service methods in cla-contributor.service.ts were updated to call v2 API endpoints instead of v3/v4, with prior endpoints left as commented lines and TODO notes. No public API signatures changed.

Changes

Cohort / File(s) Summary
API endpoint version adjustments
src/app/core/services/cla-contributor.service.ts
Updated endpoints: getUser (v3→v2), getProject (v4→v2), getUserActiveSignature (v4→v2), getGerritProjectInfo (v4→v2). Added TODO comments and preserved old URLs as comments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

wip

Suggested reviewers

  • mlehotskylf
  • ah-med
  • thakurveerendras

Poem

I thump my paws at version two,
Hop to endpoints shiny-new.
Old trails marked with TODO signs,
Commented paths, retired lines.
In burrows of code, I nibble through—
Carrots of URLs, crisp and true. 🥕

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch unicron-revert-switching-to-golang-apis-that-require-token

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

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 (2)
src/app/core/services/cla-contributor.service.ts (2)

153-156: DRY: delegate to getProject(projectId) for Gerrit project info

This endpoint and return type match getProject; delegating avoids duplication and keeps behaviors in sync.

Apply this diff:

-    // LG:TODO
-    const url = this.getV2Endpoint('/v2/project/' + projectId);
-    // const url = this.getV4Endpoint('/v4/project-compat/' + projectId);
-    return this.httpClient.get<ProjectModel>(url);
+    return this.getProject(projectId);

59-61: Replace “LG:TODO” with actionable TODOs referencing an issue/ticket

“LG:TODO” is ambiguous and easy to miss. Use a standardized format (e.g., TODO(username): short action… [JIRA-123]) so the intent and follow-up are clear and traceable.

Also applies to: 75-79, 83-86, 153-156

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 16e4f63 and ecd2996.

📒 Files selected for processing (1)
  • src/app/core/services/cla-contributor.service.ts (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/app/core/services/cla-contributor.service.ts (2)
src/app/core/models/project.ts (1)
  • ProjectModel (4-22)
src/app/core/models/active-signature.ts (1)
  • ActiveSignatureModel (4-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: snyk-scan-npm-pr
  • GitHub Check: yarn-scan-cypress-pr
  • GitHub Check: snyk-scan-edge-npm-pr
🔇 Additional comments (2)
src/app/core/services/cla-contributor.service.ts (2)

83-86: Encode userId in the URL path and validate the response model

Please update the endpoint construction to safely encode the userId, and manually confirm that the JSON returned by /v2/user/{id}/active-signature matches our ActiveSignatureModel (field names, types, and casing).

– src/app/core/services/cla-contributor.service.ts (around line 83)

-    const url = this.getV2Endpoint('/v2/user/' + userId + '/active-signature');
+    const url = this.getV2Endpoint(
+      `/v2/user/${encodeURIComponent(userId)}/active-signature`
+    );
     return this.httpClient.get<ActiveSignatureModel>(url);
  • Verify that the API’s response payload shape aligns with ActiveSignatureModel.

75-79: Verify v2 /project response shape & encode projectId

Please ensure the v2 endpoint still returns a CLA-Group payload matching ProjectModel (i.e. includes projects, foundation_sfid, project_sfid, etc.) or add an adapter if it differs. Also URL-encode the projectId to avoid path issues.

• File: src/app/core/services/cla-contributor.service.ts
Lines 75–79

Proposed change:

-    const url = this.getV2Endpoint('/v2/project/' + projectId);
+    const url = this.getV2Endpoint(`/v2/project/${encodeURIComponent(projectId)}`);

@lukaszgryglicki lukaszgryglicki merged commit f60a170 into main Aug 12, 2025
11 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.

3 participants