Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ‘½οΈ Update to Bitbucket Server 9.2 #15

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

NatoBoram
Copy link
Collaborator

@NatoBoram NatoBoram commented Oct 17, 2024

πŸ“ Description

There's a new version of the Bitbucker Server OpenAPI specs

  • Changed the URL and ran pnpm openapi-typescript

πŸ““ References

Summary by CodeRabbit

  • New Features

    • Updated OpenAPI specification to include new response codes and properties for improved error handling and forking rules.
    • Added new API endpoints for managing repository synchronization and lock information.
    • Expanded list of merge strategies to enhance flexibility in repository management.
  • Bug Fixes

    • Introduced response code 409 to indicate merge conflicts due to changes in refs.
  • Documentation

    • Updated revision identifier for the OpenAPI specification to reflect the latest changes.

@NatoBoram NatoBoram requested a review from a team as a code owner October 17, 2024 20:31
@NatoBoram NatoBoram self-assigned this Oct 17, 2024
Copy link

coderabbitai bot commented Oct 17, 2024

πŸ“ Walkthrough

Walkthrough

The pull request introduces updates to the package.json, swagger.v3.json, and openapi-typescript.ts files for the @coderabbitai/bitbucket package. The package.json file reflects a change in the OpenAPI specification URL. The swagger.v3.json file sees the addition of a new response code, expanded merge strategies, and a new property for forking rules. The openapi-typescript.ts file undergoes significant enhancements with new endpoints for repository synchronization and lock management, as well as updates to existing operations and new types.

Changes

File Change Summary
package.json Updated the URL in the preopenapi-typescript:server script from 9.1.swagger.v3.json to 9.2.swagger.v3.json.
src/cloud/openapi/swagger.v3.json Added response code 409, expanded merge strategies to include squash_fast_forward, rebase_fast_forward, and rebase_merge, introduced forking_mode property with enum values, and updated revision identifier from 33b035ea9108 to 6e8ad69baf7f.
src/server/openapi/openapi-typescript.ts Added new endpoints for out-of-sync repository IDs and repository lock owner information, repositioned an existing endpoint, updated state parameter, and defined new components and types related to repository lock management.

Possibly related PRs

Suggested labels

dependencies, enhancement, javascript


πŸͺ§ 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@NatoBoram NatoBoram enabled auto-merge (squash) October 17, 2024 20:35
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: 4

🧹 Outside diff range and nitpick comments (6)
src/cloud/openapi/swagger.v3.json (2)

15830-15833: Excellent expansion of merge strategies.

The addition of new merge strategies (squash_fast_forward, rebase_fast_forward, rebase_merge) enhances the API's functionality, providing users with more options for managing their Git workflows. This change maintains backwards compatibility while offering advanced features.

Consider updating the API documentation to explain these new merge strategies and their use cases.


31943-31947: Valuable addition of forking_mode property.

The new forking_mode property enhances workspace management capabilities by providing control over repository forking. The enum values and description are clear and concise.

Consider updating the user documentation to explain the implications of each forking mode on workspace management and security.

src/cloud/openapi/openapi-typescript.ts (3)

18962-18964: Great addition of new merge strategies!

The inclusion of "rebase_fast_forward", "rebase_merge", and "squash_fast_forward" strategies enhances the flexibility of merge operations. This aligns well with modern Git workflows.

Consider updating the relevant documentation to explain these new merge strategies and their use cases.


22085-22091: Comprehensive update of merge_strategy type

The expansion of the merge_strategy type to include the new strategies is well done. Setting "merge_commit" as the default value maintains backwards compatibility.

Consider alphabetizing the list of merge strategies for easier readability and maintenance. For example:

readonly merge_strategy?:
  | "fast_forward"
  | "merge_commit"
  | "rebase_fast_forward"
  | "rebase_merge"
  | "squash"
  | "squash_fast_forward"

22851-22859: Excellent addition of forking_mode property

The new forking_mode property with options "allow_forks" and "internal_only" provides valuable control over repository forking within a workspace. The description is clear and informative.

Consider slightly rewording the description of the "internal_only" option for clarity:

* **internal_only**: restricts forking to within the workspace, preventing forks to public repositories or outside the workspace

This wording more explicitly states the restrictions imposed by the "internal_only" option.

src/server/openapi/openapi-typescript.ts (1)

8545-8546: Correct grammatical error in documentation

The description contains a grammatical error:

"Retrieves the information about all the processes from the all the nodes in the mirror farm owning sync lock for any repository."

Consider revising for clarity:

"Retrieves information about all processes on all nodes in the mirror farm that own a sync lock for any repository."

πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

πŸ“₯ Commits

Files that changed from the base of the PR and between c0678bb and 0de2489.

πŸ“’ Files selected for processing (4)
  • package.json (1 hunks)
  • src/cloud/openapi/openapi-typescript.ts (6 hunks)
  • src/cloud/openapi/swagger.v3.json (9 hunks)
  • src/server/openapi/openapi-typescript.ts (26 hunks)
πŸ”₯ Files not summarized due to errors (1)
  • src/cloud/openapi/openapi-typescript.ts: Error: Server error: no LLM provider could handle the message
🧰 Additional context used
πŸ”‡ Additional comments (22)
src/cloud/openapi/swagger.v3.json (7)

14574-14576: Excellent addition of the 409 response code.

The new response code for merge conflicts enhances the API's error handling capabilities. The description accurately conveys the scenario where merging is not possible due to changes in the involved refs.


14674-14676: Consistent implementation of the 409 response code.

The addition of the 409 response code here maintains consistency in error handling across different endpoints. This uniformity improves the overall API design and developer experience.


16145-16148: Consistent implementation of new merge strategies.

The addition of the new merge strategies here maintains consistency across the API specification. The order of strategies is preserved, which is excellent for readability and consistency.


24674-24674: Appropriate update to the x-revision value.

The revision update to "6e8ad69baf7f" correctly reflects the changes made in this version of the API specification. This is crucial for version tracking and ensuring compatibility.


29993-30000: Comprehensive update to merge_strategy enum.

The merge_strategy enum has been successfully updated to include the new strategies, aligning with previous changes. The maintenance of "merge_commit" as the default value ensures backwards compatibility.

Please verify that "merge_commit" is still the intended default merge strategy for all relevant operations.


30026-30033: Consistent update to available merge strategies.

The available merge strategies enum has been updated consistently with previous changes. The preservation of the strategy order maintains readability and consistency throughout the API specification.


32396-32403: Consistent update to available merge strategies.

The available merge strategies enum has been updated consistently with previous changes. The preservation of the strategy order maintains readability and consistency throughout the API specification.

package.json (1)

47-47: LGTM: URL updated to Bitbucket Server 9.2 specifications

The change correctly updates the URL to fetch the latest Bitbucket Server 9.2 OpenAPI specifications. This aligns with the PR objectives and keeps the package current.

Let's verify that this is indeed the correct URL for Bitbucket Server 9.2 specifications:

This script will check if the URL is accessible and display the version from the JSON content.

βœ… Verification successful

Verification Successful: Correct URL and Version

The URL https://dac-static.atlassian.com/server/bitbucket/9.2.swagger.v3.json is accessible and returns the expected version 9.2. The change in package.json correctly updates the Bitbucket Server OpenAPI specifications.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the Bitbucket Server 9.2 OpenAPI specification URL

# Test: Check if the URL is accessible and contains the expected version
curl -s -o /dev/null -w "%{http_code}" https://dac-static.atlassian.com/server/bitbucket/9.2.swagger.v3.json
curl -s https://dac-static.atlassian.com/server/bitbucket/9.2.swagger.v3.json | jq -r '.info.version'

Length of output: 219

src/cloud/openapi/openapi-typescript.ts (3)

10371-10375: Excellent addition of the 409 conflict response!

The new 409 response code for merge conflicts due to concurrent modifications is a valuable improvement. It enhances error handling and provides more specific feedback for API consumers.


10499-10503: Consistent application of 409 conflict response

Good job on consistently applying the 409 conflict response across related API endpoints. This ensures uniform error handling for merge conflicts due to concurrent modifications.


22060-22062: Consistent application of new merge strategies

Well done on consistently applying the new merge strategies ("rebase_fast_forward", "rebase_merge", "squash_fast_forward") across related type definitions or interfaces. This ensures uniformity in merge options throughout the API.

src/server/openapi/openapi-typescript.ts (11)

9114-9118: Looks good to me

The addition of multilineAnchor, multilineStartLine, and multilineStartLineType properties enhances support for multiline comments. The changes are correctly implemented.


14485-14511: Looks good to me

The RestRepositoryLockOwner component is well-defined with appropriate properties, descriptions, and examples.


16614-16615: Looks good to me

The new type SchemaRestMultilineCommentMarker is correctly exported.


16704-16705: Looks good to me

The new type SchemaRestRepositoryLockOwner is correctly exported.


40357-40379: Looks good to me

The getRepositoryLockOwners operation is correctly defined with appropriate parameters and responses. The response schema accurately represents an array of RestRepositoryLockOwner components.


10999-11010: ⚠️ Potential issue

Inconsistent optional property modifiers

As previously noted, the multilineMarker properties have inconsistent optional modifiers. Ensure consistency by making startLineType optional if appropriate.


11505-11516: ⚠️ Potential issue

Inconsistent optional property modifiers

The multilineMarker object has startLineType as a required property, but startLine is optional. Verify if both properties should be required or optional for consistency.


15444-15455: ⚠️ Potential issue

Inconsistent optional property modifiers

As previously noted, the multilineMarker properties have inconsistent optional modifiers. Please ensure startLine and startLineType are consistently marked as optional or required.


15798-15809: ⚠️ Potential issue

Inconsistent optional property modifiers

Same issue regarding the multilineMarker properties. Ensure consistency in optionality of startLine and startLineType.


35259-35264: Verify handling of new 'OFFLINE' state in repository state logic

The state parameter now includes an additional value OFFLINE. Please ensure that any logic handling repository states correctly processes the new OFFLINE state, and that any relevant documentation and error handling are updated accordingly.

You can run the following script to search for usages of the state parameter and check for handling of the OFFLINE state:

#!/bin/bash
# Description: Find all usages of the 'state' parameter in the codebase.

# Expected output: Instances where 'state' is checked or utilised.

rg --type typescript 'state\s*[:=]\s*["\'](AVAILABLE|INITIALISING|INITIALISATION_FAILED|OFFLINE)["\']' src/

8536-8555: Ensure the new endpoint and operation are correctly defined

The endpoint /mirroring/latest/supportInfo/repo-lock-owners with GET operation getRepositoryLockOwners has been added. Please verify that getRepositoryLockOwners is properly defined in the operations object and that the necessary components and responses are correctly specified.

You can run the following script to search for the definition:

#!/bin/bash
# Description: Verify that 'getRepositoryLockOwners' is defined.

# Expected output: The definition of 'getRepositoryLockOwners' should be found.

# Search for the operation definition
rg --type typescript 'getRepositoryLockOwners' src/server/openapi/

src/server/openapi/openapi-typescript.ts Show resolved Hide resolved
src/server/openapi/openapi-typescript.ts Show resolved Hide resolved
src/server/openapi/openapi-typescript.ts Show resolved Hide resolved
src/server/openapi/openapi-typescript.ts Show resolved Hide resolved
@NatoBoram NatoBoram merged commit 8c6577d into main Oct 17, 2024
2 checks passed
@NatoBoram NatoBoram deleted the feature/bitbucket-server-9.2 branch October 17, 2024 20:43
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.

1 participant