Skip to content

Add max_terraform_state_size_bytes to the app settings API

Pam Artiaga requested to merge pam/api-settings-terraform-state-limit into master

What does this MR do and why?

We introduced a limit to the file/data accepted by the POST /projects/:project_id/terraform/state/:name API in the application_settings table, with the new field called as max_terraform_state_size_bytes. (See !106257 (merged))

Here, the new field is added to the GET /application/settings and PUT /application/settings endpoints.

This should wait for !106269 (merged) to be merged.

Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/352951

Screenshots or screen recordings

GET /application/settings

test_get_application_settings

PUT /application/settings

test_put_application_settings

Documentation

test_api_applications_settings_doc

How to set up and validate locally

  1. Make sure you have a user with admin access to a GitLab instance

  2. Create a Personal Access Token for that user, make sure it has the sudo scope

  3. Run the following curl requests:

    GET application settings

    curl -k -X GET \
    --header "Authorization: Bearer <your personal access token>" \
    "<gitlab-instance-url>/api/v4/application/settings"

    PUT application settings

    curl \
    "<gitlab-instance-url>/api/v4/application/settings" \
    -ki -X PUT \
    --header "Authorization: Bearer <your personal access token>" \
    --header "Content-Type: application/json" \
    --data "{\"max_terraform_state_size_bytes\":1000}"

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Pam Artiaga

Merge request reports

Loading