Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57751

Unable to delete server configuration

    Details

    • Similar Issues:
    • Sprint:
      GSoC 2019. Coding Phase 1

      Description

      Running the plugin with `mvn hpi:run`and a GitLab Server is added from the dropdown in Global Config. If no credentials is added to the server and server is tried to be deleted. It doesn't get deleted even upon saving the settings.

        Attachments

          Activity

          Hide
          baymac Parichay Barpanda added a comment -

          Only happens when there is only 1 GitLab Server configuration.

          Show
          baymac Parichay Barpanda added a comment - Only happens when there is only 1 GitLab Server configuration.
          Hide
          baymac Parichay Barpanda added a comment -

          This is common to all plugins like GitHub, Gitea etc

          Show
          baymac Parichay Barpanda added a comment - This is common to all plugins like GitHub, Gitea etc
          Hide
          baymac Parichay Barpanda added a comment -

          This issue was solved by modifying the `configure` method of Global configuration.

          Before:

          @Override
          public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
              req.bindJSON(this, json);
              return true;
          }

          After:

           

          @Override
          public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
              servers = req.bindJSONToList(GitLabServer.class, json.get("servers"));
              save();
              return super.configure(req, json);
          }

           

          The servers arraylist is updated with changes in Global Configuration UI.

          Show
          baymac Parichay Barpanda added a comment - This issue was solved by modifying the `configure` method of Global configuration. Before: @Override public boolean configure(StaplerRequest req, JSONObject json) throws FormException { req.bindJSON( this , json); return true ; } After:   @Override public boolean configure(StaplerRequest req, JSONObject json) throws FormException { servers = req.bindJSONToList(GitLabServer.class, json.get( "servers" )); save(); return super .configure(req, json); }   The servers arraylist is updated with changes in Global Configuration UI.

            People

            • Assignee:
              baymac Parichay Barpanda
              Reporter:
              baymac Parichay Barpanda
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: