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

api.models: Add patchset field to node revision #380

Closed
wants to merge 1 commit into from

Conversation

yurinnick
Copy link

@yurinnick yurinnick commented Oct 11, 2023

Implement patchset field for Node revision as discussed in #307:

$ curl -X 'POST' \
  'http://localhost:8001/latest/node' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsInNjb3BlcyI6WyJhZG1pbiIsInVzZXJzIl19.Y2iFFJIW8ytqajFyn02oCZAKqKwpPGBua4W1CGa775Q' \
  -H 'Content-Type: application/json' \
  -d '{
  "name":"checkout",
  "path": ["checkout"],
  "revision":{
    "tree":"mainline",
    "url":"https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git",
    "branch":"master",
    "commit":"2a987e65025e2b79c6d453b78cb5985ac6e5eb26",
    "describe":"v5.16-rc4-31-g2a987e65025e"
  }
}' | jq
{
  "id": "65271d8a74f332fbdbc8ddca",
  "kind": "node",
  "name": "checkout",
  "path": [
    "checkout"
  ],
  "group": null,
  "revision": {
    "tree": "mainline",
    "url": "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git",
    "branch": "master",
    "commit": "2a987e65025e2b79c6d453b78cb5985ac6e5eb26",
    "describe": "v5.16-rc4-31-g2a987e65025e",
    "version": null,
    "patchset": null
  },
  "parent": null,
  "state": "running",
  "result": null,
  "artifacts": null,
  "data": null,
  "created": "2023-10-11T22:11:22.200862",
  "updated": "2023-10-11T22:11:22.200864",
  "timeout": "2023-10-12T04:11:22.200867",
  "holdoff": null,
  "owner": "admin",
  "user_groups": []
}

$ curl -X 'POST' \
  'http://localhost:8001/latest/node' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsInNjb3BlcyI6WyJhZG1pbiIsInVzZXJzIl19.Y2iFFJIW8ytqajFyn02oCZAKqKwpPGBua4W1CGa775Q' \
  -H 'Content-Type: application/json' \
  -d '{
  "name":"patchset",
  "path": [
    "checkout",
    "patchset"
  ],
  "revision":{
    "tree":"mainline",
    "url":"https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git",
    "branch":"master",
    "commit":"2a987e65025e2b79c6d453b78cb5985ac6e5eb26",
    "describe":"v5.16-rc4-31-g2a987e65025e",
    "patchset": "abc123"
  },
  "artifacts": {
    "0001-patch.patch": "https://some.storage.com/0001.patch"
  }
}' | jq
{
  "id": "65271d6474f332fbdbc8ddc9",
  "kind": "node",
  "name": "patchset",
  "path": [
    "checkout",
    "patchset"
  ],
  "group": null,
  "revision": {
    "tree": "mainline",
    "url": "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git",
    "branch": "master",
    "commit": "2a987e65025e2b79c6d453b78cb5985ac6e5eb26",
    "describe": "v5.16-rc4-31-g2a987e65025e",
    "version": null,
    "patchset": "abc123"
  },
  "parent": null,
  "state": "running",
  "result": null,
  "artifacts": {
    "0001-patch.patch": "https://some.storage.com/0001.patch"
  },
  "data": null,
  "created": "2023-10-11T22:10:44.071451",
  "updated": "2023-10-11T22:10:44.071454",
  "timeout": "2023-10-12T04:10:44.071458",
  "holdoff": null,
  "owner": "admin",
  "user_groups": []
}

@gctucker
Copy link
Contributor

This and other PRs still need to be properly reviewed though, as per the discussions in previous Open Hours. I think it's making good progress and ideally this should be part of the stable candidates for the 4th Dec milestone.

@pawiecz pawiecz self-requested a review December 8, 2023 20:52
@gctucker
Copy link
Contributor

@yurinnick Also please consider adding unit tests and end-to-end tests to cover the new field and patchset functionality. This could be done as a follow-up, it would have been nice to have it as part of the same PR ideally but I don't think it's a blocking issue.

@JenySadadia JenySadadia added the staging-skip Don't test automatically on staging.kernelci.org label Jan 9, 2024
@JenySadadia
Copy link
Collaborator

Adding staging-skip as it conflicts with #433 on staging.

@pawiecz
Copy link
Contributor

pawiecz commented Jan 12, 2024

@yurinnick With #433 merged this PR will need to be converted into a change to Revision model in kernelci-core.

Please let me know if it would be OK with you if I moved this change there (preserving your SoB of course), tag kernelci/kernelci-pipeline#342 with a new dependency and later close this PR.

pawiecz added a commit to pawiecz/kernelci-core that referenced this pull request Jan 16, 2024
This patch was initially submitted as kernelci/kernelci-api#380 but
required moving after merging kernelci/kernelci-api#433.

Signed-off-by: Nikolay Yurin <[email protected]>
pawiecz added a commit to pawiecz/kernelci-core that referenced this pull request Jan 16, 2024
This patch was initially submitted as kernelci/kernelci-api#380 but
required moving after merging kernelci/kernelci-api#433.

Signed-off-by: Nikolay Yurin <[email protected]>
Signed-off-by: Paweł Wieczorek <[email protected]>
github-merge-queue bot pushed a commit to kernelci/kernelci-core that referenced this pull request Jan 19, 2024
This patch was initially submitted as kernelci/kernelci-api#380 but
required moving after merging kernelci/kernelci-api#433.

Signed-off-by: Nikolay Yurin <[email protected]>
Signed-off-by: Paweł Wieczorek <[email protected]>
@pawiecz
Copy link
Contributor

pawiecz commented Mar 4, 2024

These changes have been moved to kernelci-core repository in kernelci/kernelci-core#2301 and are now available for use in API/Pipeline services.

@pawiecz pawiecz closed this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging-skip Don't test automatically on staging.kernelci.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants