Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
R
rust-gitlab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Utils
  • rust-gitlab
  • Issues
  • #41

Closed
Open
Opened May 24, 2020 by Bradley Wood@bradwoodContributor

BUG: CreateProject() new API ignores wiki_access_level

Hey guys, this call looks like it just doesn't work. I've tried it both on gitlab.com and gitlab.kitware.com with the same problem

Calling code:

    //...<snip>...
    let mut p = CreateProject::builder();

    if args.occurrences_of("default_branch") > 0 {
        debug!("default_branch");
        p.default_branch(args.value_of("default_branch").unwrap());
    }

    if args.occurrences_of("visibility") > 0 {
        debug!("visibility");
        p.visibility(visibility_level_from_str(args.value_of("visibility").unwrap()).unwrap());
    }

    if args.occurrences_of("wiki_access_level") > 0 {
        debug!("wiki_access_level");
        p.wiki_access_level(
            feature_access_level_from_str(args.value_of("wiki_access_level").unwrap()).unwrap(),
        );
    }
    let endpoint = p.name(args.value_of("name").unwrap()).build().unwrap();

    debug!("args: {:#?}", args);
    debug!("endpoint: {:#?}", endpoint);

    let project: Project = endpoint.query(&gitlabclient)
        .context("Failed to create project - check for name or path clashes on the server")?;

    println!("Project id: {}", project.id);
    println!("Project URL: {}", project.web_url);
    Ok(())
    //...

Debug Output (snipped)

git_lab::cmds::project::create: endpoint: CreateProject {
    name_and_path: Name {
        name: "test5",
    },
    namespace_id: None,
    default_branch: Some(
        "bladdf",
    ),
    description: None,
    issues_access_level: None,
    repository_access_level: None,
    merge_requests_access_level: None,
    forking_access_level: None,
    builds_access_level: None,
    wiki_access_level: Some(
        Disabled,
    ),
    snippets_access_level: None,
    pages_access_level: None,
    emails_disabled: None,
    resolve_outdated_diff_discussions: None,
    container_registry_enabled: None,
    container_expiration_policy_attributes: None,
    shared_runners_enabled: None,
    visibility: Some(
        Public,
    ),
    import_url: None,
    public_builds: None,
    only_allow_merge_if_pipeline_succeeds: None,
    only_allow_merge_if_all_discussions_are_resolved: None,
    merge_method: None,
    autoclose_referenced_issues: None,
    remove_source_branch_after_merge: None,
    lfs_enabled: None,
    request_access_enabled: None,
    tag_list: {},
    printing_merge_request_link_enabled: None,
    build_git_strategy: None,
    build_timeout: None,
    auto_cancel_pending_pipelines: None,
    build_coverage_regex: None,
    ci_config_path: None,
    auto_devops_enabled: None,
    auto_devops_deploy_strategy: None,
    repository_storage: None,
    approvals_before_merge: None,
    external_authorization_classification_label: None,
    mirror: None,
    mirror_trigger_builds: None,
    initialize_with_readme: None,
    template_name: None,
    template_project_id: None,
    use_custom_template: None,
    group_with_project_templates_id: None,
    packages_enabled: None,
    issues_enabled: None,
    merge_requests_enabled: None,
    jobs_enabled: None,
    wiki_enabled: None,
    snippets_enabled: None,
}
gitlab::gitlab: REST api call projects
hyper::client::pool: reuse idle connection for ("https", gitlab.kitware.com)
hyper::proto::h1::io: flushed 256 bytes
hyper::proto::h1::io: read 3522 bytes
hyper::proto::h1::io: parsed 14 headers
hyper::proto::h1::conn: incoming body is content-length (3053 bytes)
hyper::proto::h1::conn: incoming body completed
hyper::client::pool: pooling idle connection for ("https", gitlab.kitware.com)
reqwest::async_impl::client: response '201 Created' for https://gitlab.kitware.com/api/v4/projects?name=test5&default_branch=bladdf&wiki_access_level=disabled&visibility=public
Project id: 5499
Project URL: https://gitlab.kitware.com/bradwood/test5

The project visibility sets fine, but the wiki_access_level just seems to be flat-out ignored...

Any thoughts?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: utils/rust-gitlab#41