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(sdf): Add apply/merge_status automation API endpoints #5277

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

jkeiser
Copy link
Contributor

@jkeiser jkeiser commented Jan 16, 2025

  • Copies over almost verbatim the existing force_apply and request_approval endpoints to the automation API, so that we can make a Github Action trigger a management function and merge to HEAD (or request merge to head).
  • Adds a "merge_status" endpoint to the automation API, which yields the status of the changeset and any actions enqueued from it in this format:
    {
      "changeSet": {
        "createdAt": "2025-01-18T01:20:59.869049Z",
        "updatedAt": "2025-01-18T01:25:44.315196Z",
        "name": "2025-01-18-01:20",
        "id": "01JHVFZFYS5N65J4QN76004G9N",
        "status": "Applied",
        "baseChangeSetId": "01JH8VFFYD4FAYF1VPCS7TSWHX",
        "workspaceId": "01JH8VEGZYXF5WYFF9Z538F3Q0",
        "mergeRequestedByUserId": "01JH8VEGMN6Q385M3Q44RWJG22",
        "mergeRequestedByUser": "jkeiser",
        "mergeRequestedAt": "2025-01-18T01:25:44.264742Z",
        "reviewedByUserId": "01JH8VEGMN6Q385M3Q44RWJG22",
        "reviewedByUser": "jkeiser",
        "reviewedAt": "2025-01-18T01:25:44.265236Z"
      },
      "actions": [
        {
          "id": "01JHVFZGPZNAH3V455GQZQ73Q0",
          "component": {
            "id": "01JHVFZGPW25N85NJ1SGGVYDRR",
            "name": "foo-vpc"
          },
          "state": "Failed",
          "kind": "Create",
          "name": "Create"
        },
        {
          "id": "01JHVFZGPW25N85NJ1SGGVYDRM",
          "component": {
            "id": "01JHVFZGPSN7RK7T20B1F22S2T",
            "name": "EIP_1"
          },
          "state": "Failed",
          "kind": "Create",
          "name": "Create"
        },
        {
          "id": "01JHVFZGPKPGGMP0T67KHHESE9",
          "component": {
            "id": "01JHVFZGPG2FB6H27VG5JCC3G3",
            "name": "foo-Public Route Table"
          },
          "state": "Queued",
          "kind": "Create",
          "name": "Create"
        },
      ]
    }

Testing

I've tested all three of these endpoints through curl. There are no automated tests in this commit (as with other automation API endpoints), but tests of the github action itself (which are more end to end) will include these. There will be a couple more turns of the crank on these APIs over the next week.

I have verified existing functionality is generally working through the webui as well (creating components, running management functions, and applying changesets). Beyond that, this is entirely new code, limited to the new endpoints under a feature flag, so there should be no risk to the main product.

Copy link

github-actions bot commented Jan 16, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@github-actions github-actions bot added the A-sdf Area: Primary backend API service [Rust] label Jan 16, 2025
@jkeiser jkeiser force-pushed the jkeiser/apply-changeset-endpoint branch 3 times, most recently from a59c9e9 to 411cfc8 Compare January 16, 2025 22:10
@jkeiser jkeiser changed the title feat(sdf): Add apply_changeset and request_approval automation API endpoints feat(sdf): Add request_approval automation API endpoint Jan 16, 2025
@jkeiser jkeiser force-pushed the jkeiser/apply-changeset-endpoint branch from 411cfc8 to 903f5ca Compare January 18, 2025 00:04
@jkeiser jkeiser changed the title feat(sdf): Add request_approval automation API endpoint feat(sdf): Add force_apply/request_approval automation API endpoints Jan 18, 2025
@jkeiser jkeiser force-pushed the jkeiser/apply-changeset-endpoint branch from 903f5ca to 2f2ee47 Compare January 18, 2025 00:15
@jkeiser
Copy link
Contributor Author

jkeiser commented Jan 18, 2025

Dropping this back to Draft briefly to add another endpoint. May as well round it out!

@jkeiser jkeiser marked this pull request as draft January 18, 2025 01:07
@jkeiser jkeiser force-pushed the jkeiser/apply-changeset-endpoint branch from 2f2ee47 to 253022f Compare January 18, 2025 01:08
@github-actions github-actions bot added the A-dal label Jan 18, 2025
@jkeiser jkeiser force-pushed the jkeiser/apply-changeset-endpoint branch from 253022f to b978e40 Compare January 18, 2025 01:46
@jkeiser jkeiser marked this pull request as ready for review January 18, 2025 01:55
@jkeiser jkeiser changed the title feat(sdf): Add force_apply/request_approval automation API endpoints feat(sdf): Add apply/merge_status automation API endpoints Jan 18, 2025
@johnrwatson
Copy link
Contributor

@jkeiser Component type would be super useful in this response

{
      "id": "01JHVFZGPW25N85NJ1SGGVYDRM",
      "component": {
        "id": "01JHVFZGPSN7RK7T20B1F22S2T",
              <------- in here!
        "name": "EIP_1"
      },
      "state": "Failed",
      "kind": "Create",
      "name": "Create"
    },
    ```

@jkeiser
Copy link
Contributor Author

jkeiser commented Jan 21, 2025

@johnrwatson will do! I want to get this merged soon to unblock, but I'll post a followup with a little more meat on the responses!

@jkeiser jkeiser added this pull request to the merge queue Jan 21, 2025
Merged via the queue into main with commit 8c08d1e Jan 21, 2025
9 checks passed
@jkeiser jkeiser deleted the jkeiser/apply-changeset-endpoint branch January 21, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dal A-sdf Area: Primary backend API service [Rust]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants