Skip to content

Validate spec.git_provider.url #1852

Open
@ralphbean

Description

I ran into a case in the Fedora instance of Konflux where a user entered gitlab.com for their git-provider-url.

PaC accepted it no problem, but when it tried to operate on an incoming webhook, it failed hard because the url was missing its https:// prefix with errors like:

There was an error while processing the payload: Get \"gitlab.com/api/v4/projects/<project_id>/merge_requests/<merge_request_id>/discussions?page=1\": unsupported protocol scheme \"\"

and

Cannot create status: Get \"gitlab.com/api/v4/projects/<project_id>/merge_requests/<merge_request_id>/discussions?page=1\": unsupported protocol scheme \"\": Post \"gitlab.com/api/v4/projects/<project_id>/merge_requests/<merge_request_id>/notes\": unsupported protocol scheme \"\"

PaC should start validating that field when it is submitted and reject Repository resources that don't conform to an expected schema.

Related issue for Konflux filed at konflux-ci/build-service#379.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions