Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
r33drichards opened this issue Jul 11, 2024 · 1 comment
Open
3 tasks done
Labels
bug Something isn't working
Milestone

Comments

@r33drichards
Copy link

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 #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

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Checked that the bug isn't fixed in the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
@r33drichards r33drichards added the bug Something isn't working label Jul 11, 2024
@anbraten
Copy link
Member

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

@qwerty287 qwerty287 added schema and removed schema labels Jul 18, 2024
@6543 6543 added this to the 3.0.0 milestone Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants