Skip to content

fix: Move expires_in field after scope in OAuth2 datasource configuration#41659

Open
xingzihai wants to merge 2 commits intoappsmithorg:releasefrom
xingzihai:fix/oauth2-expires-in-field-reorder
Open

fix: Move expires_in field after scope in OAuth2 datasource configuration#41659
xingzihai wants to merge 2 commits intoappsmithorg:releasefrom
xingzihai:fix/oauth2-expires-in-field-reorder

Conversation

@xingzihai
Copy link
Copy Markdown

@xingzihai xingzihai commented Mar 26, 2026

Summary

This PR moves the Authorization expires in (seconds) input field to appear right after the Scope(s) field in the OAuth2 datasource configuration form.

Problem

Previously, the expires_in field was rendered after the Custom Authentication Parameters section, making it harder for users to discover this authentication-related field.

Solution

  • Moved the expiresIn field from renderOauth2AuthorizationCode() to renderOauth2Common()
  • Placed it right after the scopeString field, before Client Authentication
  • Added a conditional check to only show it for Authorization Code grant type (since it only applies to that grant type)

Testing

  • Verified that the field order is now: Scope(s) → Authorization expires in (seconds) → Client Authentication
  • The change only affects OAuth2 Authorization Code grant type

Related Issue

Fixes #31059

Summary by CodeRabbit

  • Documentation

    • Expanded contribution guidelines with new sections covering development setup, project architecture, and contribution process.
  • Refactor

    • Reorganized OAuth2 configuration form layout.

- Add table of contents for easy navigation
- Add project architecture overview with tech stack
- Add quick start checklist for new contributors
- Add finding issues section with categorized links
- Add development setup quick guide
- Add pull request process guidelines
- Add community support channels
- Improve overall structure and organization
…tion

This change moves the 'Authorization expires in (seconds)' input field
to appear right after the 'Scope(s)' field in the OAuth2 datasource
configuration form, making all authentication-related fields adjacent
to each other for better user discoverability.

Fixes appsmithorg#31059
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

Walkthrough

Documentation for contribution guidelines was comprehensively reorganized with new sections covering project architecture, development setup, and pull request processes. Additionally, an OAuth2 form field (expiresIn) was relocated to appear conditionally alongside other authentication fields rather than in a separate section.

Changes

Cohort / File(s) Summary
Documentation Expansion
CONTRIBUTING.md
Extensive restructure with new Table of Contents, Project Architecture, Development Setup, Pull Request Process, and Community Support sections. Adds detailed guidance for bug reports, feature requests, and contribution types with links to contribution guides.
OAuth2 Form Reorganization
app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx
Relocated authentication.expiresIn field from standalone rendering in renderOauth2AuthorizationCode() to conditional rendering within renderOauth2Common() when grant type is AuthorizationCode, co-locating related authentication fields.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~18 minutes

Poem

🔐 Fields now huddle close, no longer adrift,

Documentation blooms with helpful gifts,

OAuth2 config finds its rightful place—

A tidy form with newfound grace! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning All code changes in RestAPIDatasourceForm.tsx are scoped to the expiresIn field reordering; CONTRIBUTING.md updates are documentation-only and unrelated to the linked issue. The CONTRIBUTING.md changes appear unrelated to issue #31059. Verify these changes belong in this PR or separate them into a different pull request.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: moving the expires_in field after scope in OAuth2 configuration, matching the code modifications.
Description check ✅ Passed The description includes summary, problem statement, solution details, testing validation, and links to the related issue #31059, meeting template requirements.
Linked Issues check ✅ Passed The code changes directly address issue #31059 by moving the expiresIn field from renderOauth2AuthorizationCode() to renderOauth2Common() with conditional rendering, matching the stated objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

@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 (1)
CONTRIBUTING.md (1)

55-76: Move checklist items into a feature-specific root task-list markdown file.

The checklist is useful, but this repo rule asks task lists to live in a dedicated root markdown file named for the feature.

As per coding guidelines, "Create task lists in a markdown file (in the project root): Use a descriptive name relevant to the feature (e.g., ASSISTANT_CHAT.md)."

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

In `@CONTRIBUTING.md` around lines 55 - 76, Move the entire "Quick Start
Checklist" section out of CONTRIBUTING.md into a new root markdown task-list
file named for the feature (e.g., QUICK_START_CHECKLIST.md or a descriptive
feature name like ASSISTANT_ONBOARDING.md) and keep the same headings and
checklist items ("Before You Start", "For Code Contributions", "For
Documentation Contributions"). In CONTRIBUTING.md, replace the removed checklist
with a short link/reference to the new root file (e.g., "See
QUICK_START_CHECKLIST.md for the checklist") so readers are pointed to the
dedicated task-list file; ensure the new file retains the original checklist
formatting and links.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CONTRIBUTING.md`:
- Around line 29-42: The fenced architecture tree in CONTRIBUTING.md is missing
a language identifier; update the code fence that wraps the directory tree (the
triple-backtick block showing "appsmith/ ├── app/ ...") to include a language
tag (e.g., ```text) so the renderer and linters recognize it as plain text and
maintain formatting.

---

Nitpick comments:
In `@CONTRIBUTING.md`:
- Around line 55-76: Move the entire "Quick Start Checklist" section out of
CONTRIBUTING.md into a new root markdown task-list file named for the feature
(e.g., QUICK_START_CHECKLIST.md or a descriptive feature name like
ASSISTANT_ONBOARDING.md) and keep the same headings and checklist items ("Before
You Start", "For Code Contributions", "For Documentation Contributions"). In
CONTRIBUTING.md, replace the removed checklist with a short link/reference to
the new root file (e.g., "See QUICK_START_CHECKLIST.md for the checklist") so
readers are pointed to the dedicated task-list file; ensure the new file retains
the original checklist formatting and links.
🪄 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: f2732efc-ed37-47f4-a61d-2771c869eacb

📥 Commits

Reviewing files that changed from the base of the PR and between 089d24f and 679e9d1.

📒 Files selected for processing (2)
  • CONTRIBUTING.md
  • app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx

Comment on lines +29 to +42
```
appsmith/
├── app/
│ ├── client/ # Frontend (React + TypeScript)
│ │ ├── src/ # React components, widgets, utilities
│ │ ├── cypress/ # Cypress integration tests
│ │ └── packages/ # Shared packages including RTS (Real-Time Server)
│ └── server/ # Backend (Java + Spring + WebFlux)
│ ├── appsmith-server/ # Main server application
│ └── appsmith-plugins/ # Database/API connectors
├── deploy/ # Docker & Kubernetes deployment configs
├── contributions/ # Contribution guides and documentation
└── static/ # Static assets for documentation
```
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.

⚠️ Potential issue | 🟡 Minor

Add a language identifier to the fenced code block.

The architecture tree block should declare a language (for lint compliance and renderer consistency).

Suggested fix
-```
+```text
 appsmith/
 ├── app/
 │   ├── client/          # Frontend (React + TypeScript)
 │   │   ├── src/         # React components, widgets, utilities
 │   │   ├── cypress/     # Cypress integration tests
 │   │   └── packages/    # Shared packages including RTS (Real-Time Server)
 │   └── server/          # Backend (Java + Spring + WebFlux)
 │       ├── appsmith-server/     # Main server application
 │       └── appsmith-plugins/    # Database/API connectors
 ├── deploy/              # Docker & Kubernetes deployment configs
 ├── contributions/       # Contribution guides and documentation
 └── static/              # Static assets for documentation
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **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.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 29-29: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

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

In `@CONTRIBUTING.md` around lines 29 - 42, The fenced architecture tree in
CONTRIBUTING.md is missing a language identifier; update the code fence that
wraps the directory tree (the triple-backtick block showing "appsmith/ ├── app/
...") to include a language tag (e.g., ```text) so the renderer and linters
recognize it as plain text and maintain formatting.

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.

[Task]: Move expires_in field after scope while configuring oauth2 datasource

1 participant