woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.07k stars 351 forks source link

"options" cannot be bound multiple times in the same parameter list #3886

Open r33drichards opened 1 month ago

r33drichards commented 1 month ago

Component

server

Describe the bug

When using the typescript client generated from the openapi schema, i get the following error when building my nuxtjs project

 ERROR  Error: Transform failed with 1 error:                                                                                nitro 5:36:29 PM
/Users/robertwendt/dash/woodpecker-client/api.ts:4514:102: ERROR: "options" cannot be bound multiple times in the same parameter list

"options" cannot be bound multiple times in the same parameter list

the offending functions signature in the generated code

    public reposRepoIdPipelinesPost (authorization: string, repoId: number, options: PipelineOptions, options: any = {}) : Promise<{ response: http.ClientResponse; body: Pipeline;  }> {

I think that https://github.com/woodpecker-ci/woodpecker/pull/3885 should fix it but I'm not sure how to proceed (if at all)

Steps to reproduce

Install woodpecker with the following configuration

        packages.nixosConfigurations.woodpecker = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = {
            inherit inputs;
          };
          modules = [
            inputs.comin.nixosModules.comin
            flakery.nixosModules.flakery
            flakery.nixosConfigurations.base
            {
              services.promtail = {
                enable = true;
                configuration = {
                  server = {
                    http_listen_port = 9080;
                    grpc_listen_port = 0;
                  };
                  clients = [{ url = "http://grafana:3100/loki/api/v1/push"; }];
                  scrape_configs = [
                    {
                      job_name = "system";
                      static_configs = [
                        {
                          targets = [ "localhost" ];
                          labels = {
                            job = "varlogs";
                            __path__ = "/var/log/*log";
                          };
                        }

                      ];
                    }
                    {
                      job_name = "journal";
                      journal = {
                        max_age = "12h";
                        labels = {
                          job = "systemd-journal";
                          host = "woodpecker";
                        };
                      };
                      relabel_configs = [{
                        source_labels = [ "__journal__systemd_unit" ];
                        target_label = "unit";
                      }];
                    }

                  ];
                };
              };

              networking.firewall.allowedTCPPorts = [ 3007 9002 ];
              services.prometheus = {
                enable = true;
                port = 9090;
                exporters = {
                  node = {
                    enable = true;
                    enabledCollectors = [ "systemd" ];
                    port = 9002;
                  };

                };
              };

              services.tailscale = {
                enable = true;
                authKeyFile = "/tsauthkey";
                extraUpFlags = [ "--ssh" "--hostname" "woodpecker" ];
              };

              services.woodpecker-server = {
                enable = true;
                package = woodpecker;

                environment = {
                  WOODPECKER_SERVER_ADDR = ":3007";
                  WOODPECKER_HOST = "https://woodpecker-ci-19fcc5.flakery.xyz";
                  WOODPECKER_OPEN = "true";
                  WOODPECKER_ORGS = "getflakery";
                  WOODPECKER_GITHUB = "true";
                  WOODPECKER_GITHUB_CLIENT = "Ov23li77VshZc9W7M4Gp";
                  WOODPECKER_GITHUB_SECRET = builtins.readFile /github-client-secret;
                  WOODPECKER_AGENT_SECRET = builtins.readFile /agent-secret;
                  WOODPECKER_ADMIN = "r33drichards";
                  WOODPECKER_DATABASE_DRIVER = "postgres";
                  WOODPECKER_DATABASE_DATASOURCE = builtins.readFile /pgurl;
                };
                # You can pass a file with env vars to the system it could look like:
                # environmentFile = "/path/to/my/secrets/file";
              };

              # This sets up a woodpecker agent
              services.woodpecker-agents.agents."docker" = {
                enable = true;
                package = woodpecker-agent;

                # We need this to talk to the podman socket
                extraGroups = [ "podman" ];
                environment = {
                  WOODPECKER_SERVER = "localhost:9000";
                  WOODPECKER_MAX_WORKFLOWS = "4";
                  DOCKER_HOST = "unix:///run/podman/podman.sock";
                  WOODPECKER_BACKEND = "docker";
                  WOODPECKER_AGENT_SECRET = builtins.readFile /agent-secret;

                };
                # Same as with woodpecker-server
                # environmentFile = [ "/var/lib/secrets/woodpecker.env" ];
              };

              # Here we setup podman and enable dns
              virtualisation.podman = {
                enable = true;
                defaultNetwork.settings = {
                  dns_enabled = true;
                };
                dockerSocket.enable = true;
              };
              # This is needed for podman to be able to talk over dns
              networking.firewall.interfaces."podman0" = {
                allowedUDPPorts = [ 53 ];
                allowedTCPPorts = [ 53 ];
              };
            }

          ];
        };

download openapi spec

generate typescript client using https://editor-next.swagger.io/

use the client in nuxt js app and call the function reposRepoIdPipelinesPost

observe the error when building

Expected behavior

should just call the function as expected

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"2.6.0"}

Additional context

No response

Validations

anbraten commented 1 month ago

What I am not getting is where options is bound the first time 🤔