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

feat(api): implement branch/commit comparison API #30349

Merged
merged 13 commits into from
Apr 16, 2024
Merged

Commits on Apr 13, 2024

  1. feat: implement commit comparison API endpoint

    - Add new `Compare` struct to represent comparison between two commits
    - Introduce new API endpoint `/compare/*` to get commit comparison information
    - Create new file `repo_compare.go` with the `Compare` struct definition
    - Add new file `compare.go` in `routers/api/v1/repo` to handle comparison logic
    - Add new file `compare.go` in `routers/common` to define `CompareInfo` struct
    - Refactor `ParseCompareInfo` function to use `common.CompareInfo` struct
    - Update Swagger documentation to include the new API endpoint for commit comparison
    - Remove duplicate `CompareInfo` struct from `routers/web/repo/compare.go`
    - Adjust base path in Swagger template to be relative (`/api/v1`)
    
    Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
    appleboy committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    0740351 View commit details
    Browse the repository at this point in the history
  2. feat: refactor API comparison structures

    - Add a new `swaggerCompare` struct for API response in `repo.go`
    - Update the `basePath` in `v1_json.tmpl` to include `AppSubUrl`
    - Define a new `Compare` object in Swagger JSON template with properties `commits` and `total_commits`
    - Add a reference to the `Compare` definition in Swagger JSON template
    
    Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
    appleboy committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    b39e615 View commit details
    Browse the repository at this point in the history
  3. docs: update

    Signed-off-by: appleboy <appleboy.tw@gmail.com>
    appleboy committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    6b8c322 View commit details
    Browse the repository at this point in the history
  4. test: add unit testing.

    appleboy committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    1719ef5 View commit details
    Browse the repository at this point in the history
  5. chore: update

    Signed-off-by: appleboy <appleboy.tw@gmail.com>
    appleboy committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    e37ebf2 View commit details
    Browse the repository at this point in the history
  6. chore: update

    Signed-off-by: appleboy <appleboy.tw@gmail.com>
    appleboy committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    ab5dcda View commit details
    Browse the repository at this point in the history
  7. update

    Signed-off-by: appleboy <appleboy.tw@gmail.com>
    appleboy committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    c2c3e59 View commit details
    Browse the repository at this point in the history
  8. update

    Signed-off-by: appleboy <appleboy.tw@gmail.com>
    appleboy committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    a21234b View commit details
    Browse the repository at this point in the history
  9. chore: check permission

    Signed-off-by: appleboy <appleboy.tw@gmail.com>
    appleboy committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    6ce81db View commit details
    Browse the repository at this point in the history
  10. Update api.go

    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    appleboy and lunny authored Apr 13, 2024
    Configuration menu
    Copy the full SHA
    7d9723d View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2024

  1. Configuration menu
    Copy the full SHA
    dc7078d View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2024

  1. refactor: simplify logic and improve variable clarity

    - Remove unused imports and functions
    - Refactor the `ParseCompareInfo` function to simplify the logic
    - Update variable names for clarity
    - Adjust the comparison of commits in the `CompareDiff` function
    
    Signed-off-by: appleboy <appleboy.tw@gmail.com>
    appleboy committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    94746ec View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. Configuration menu
    Copy the full SHA
    944c525 View commit details
    Browse the repository at this point in the history