Skip to content

ProjectApi.updateProject() is missing 35 supported PUT /projects/:id attributes #1324

@bigpuritz

Description

@bigpuritz

Summary

ProjectApi.updateProject(Project) is missing 35 attributes that the GitLab REST API supports for PUT /projects/:id. As a result, these settings cannot be changed through GitLab4J-API even though the GitLab server accepts them.

Reference: GitLab API – Edit/Update a project (also doc/api/projects.md, sections "Update a project" and "Project feature visibility level").

The 19 *_access_level attributes are already fully covered. The gap is in the general project attributes.

Missing parameters

Parameter Type Note
allow_merge_on_skipped_pipeline boolean
allow_pipeline_trigger_approve_deployment boolean Premium/Ultimate
auto_devops_deploy_strategy string
auto_devops_enabled boolean
auto_duo_code_review_enabled boolean Ultimate
ci_default_git_depth integer
ci_display_pipeline_variables boolean
ci_forward_deployment_rollback_allowed boolean
ci_allow_fork_pipelines_to_run_in_parent_project boolean
ci_id_token_sub_claim_components array
ci_separated_caches boolean
ci_restrict_pipeline_cancellation_role string Premium/Ultimate
ci_push_repository_for_job_token_allowed boolean
duo_remote_flows_enabled boolean
duo_sast_fp_detection_enabled boolean
duo_sast_vr_workflow_enabled boolean
enforce_auth_checks_on_uploads boolean
import_url string
keep_latest_artifact boolean
max_artifacts_size integer
merge_pipelines_enabled boolean
mr_default_title_template string
merge_trains_enabled boolean
merge_trains_skip_train_allowed boolean
max_pipelines_per_merge_train integer
mirror_overwrites_diverged_branches boolean Premium/Ultimate
mirror_user_id integer Premium/Ultimate, admin only
mr_default_target_self boolean
only_mirror_protected_branches boolean Premium/Ultimate
package_registry_access_level string successor of deprecated packages_enabled
prevent_merge_without_jira_issue boolean Ultimate
protect_merge_request_pipelines boolean
service_desk_enabled boolean
spp_repository_pipeline_access boolean Ultimate
web_based_commit_signing_enabled boolean GitLab.com only

Additional notes

  • Deprecated and already superseded by attributes that are present, so adding them is not required: emails_disabled (→ emails_enabled), restrict_user_defined_variables (→ ci_pipeline_variables_minimum_override_role).
  • avatar is intentionally not part of updateProject — it is covered by the dedicated multipart method setProjectAvatar(...). Not an issue.
  • Reverse direction (out of scope here, noted for completeness): updateProject still sends build_coverage_regex, which no longer exists in the current PUT /projects/:id specification. template_name, use_custom_template, group_with_project_templates_id, and repository_object_format are create-only parameters that have no effect on update.

Proposed fix

Add the missing parameters to ProjectApi.updateProject(Project) and add the corresponding fields/getters/setters to the Project model where they do not yet exist.

Environment

  • GitLab4J-API: 6.3.1-SNAPSHOT (main)
  • Affected file: gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java (updateProject)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions