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

[JENKINS-24702] Migration to credentials instead of plain token usage #65

Merged
merged 12 commits into from
Aug 11, 2015

Conversation

lanwen
Copy link
Member

@lanwen lanwen commented Jul 26, 2015

JENKINS-24702

Continue of #45

Default empty configuration

2015-07-31 14-46-06 configure system jenkins

With one credential (not saved)

2015-07-31 22-53-01 configure system jenkins

With one credential (after refresh)

2015-07-31 14-48-09 configure system jenkins

Advanced

2015-07-31 14-48-58 configure system jenkins

Generated xml config:

<github-plugin plugin="github@1.12.1-SNAPSHOT">
  <configuration>
    <configs>
      <github-server-config>
        <apiUrl>https://api.github.com</apiUrl>
        <manageHooks>true</manageHooks>
        <credentialsId>ad5aaa14-d65e-4b4a-8884-0c0504a0495f</credentialsId>
      </github-server-config>
    </configs>
  </configuration>
</github-plugin>

Review on Reviewable

/**
* @author lanwen (Merkushev Kirill)
*/
@XStreamAlias("github")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want alias?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to simplify xml (for easier migration)

<github-plugin plugin="github@1.12.1-SNAPSHOT">
  <configuration>
    <configs>
      <github>
        <credentialsId>0986964f-727c-4684-8a01-91bbf1238bd2</credentialsId>
      </github>
      <github>
        <apiUrl>https://gh.ent.company.com/api/v3</apiUrl>
        <credentialsId>0986964f-727c-4684-8a01-91bbf1238bd2</credentialsId>
      </github>
    </configs>
  </configuration>
</github-plugin>

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@lanwen lanwen changed the title WIP [JENKINS-24702] Migration to credentials instead of plain token usage [JENKINS-24702] Migration to credentials instead of plain token usage Jul 31, 2015
private static final String UNKNOWN_TOKEN = "unkn";

private String apiUrl;
private boolean dontUseItToMangeHooks;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad name!
just call manageHooks = true

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

@lanwen
Copy link
Member Author

lanwen commented Aug 2, 2015

src/main/java/com/cloudbees/jenkins/GitHubRepositoryName.java, line 71 [r2] (raw file):
reviewable.io can help to ignore such small reformat changes. It very hard to ignore formatting of such small pieces


Comments from the review on Reviewable.io

@@ -0,0 +1,22 @@
<?xml version='1.0' encoding='UTF-8'?>
<com.cloudbees.jenkins.GitHubPushTrigger_-DescriptorImpl plugin="github@1.11.4-SNAPSHOT">
<manageHook>true</manageHook>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manageHook or manageHooks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KostyaSha
Copy link
Member

@KostyaSha
Copy link
Member

@lanwen
Copy link
Member Author

lanwen commented Aug 2, 2015

src/main/java/com/cloudbees/jenkins/GitHubRepositoryName.java, line 90 [r2] (raw file):
because of the oracle code style restrictions


Comments from the review on Reviewable.io

@KostyaSha
Copy link
Member

@KostyaSha
Copy link
Member

Reviewable doesn't reply into line comments :(

@KostyaSha
Copy link
Member

pom.xml, line 79 [r4] (raw file):
spaces?


Comments from the review on Reviewable.io

@KostyaSha
Copy link
Member

sorry bad cache, deleted wrong comments.

}
}

f.entry(title: _("Additional actions"), help: descriptor.getHelpFile('additional')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not obvious for end-user.
If it only helper for "generating token", then put it under f.advanced(title="Token generator") {}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not often case. Who wants, finds this without problem

@KostyaSha
Copy link
Member

Sent simplifcation in lanwen#1

Also it unclear what type of creds should be added because "Add" button doesn't limit possible key types (had reports in other plugin). Should GitHub have special credentials type to have "Github Token" type to not mix it with other possible types?

@lanwen
Copy link
Member Author

lanwen commented Aug 4, 2015

@KostyaSha I desagree with such simplification. It's not a simplification it's a just another ui with one more textbox, showed all time.

@lanwen
Copy link
Member Author

lanwen commented Aug 4, 2015

Any credentials selection use case improvements should be done in separate prs. I don't plan to rewrite all use cases here

@KostyaSha
Copy link
Member

Any credentials selection use case improvements should be done in separate prs. I don't plan to rewrite all use cases here

I didn't mean you implement it here. Just noted.

@KostyaSha I disagree with such simplification. It's not a simplification it's a just another ui with one more textbox, showed all time. Why do you think only your opinion is right and nobody can do anything without your advice?

KostyaSha@ab0f56a imho this a real bugfix, see commit description

- with credentials usage
- with migrator from old gh-push-trigger descriptor config options to new gh-plugin
- with bean class to store deprecated creds (used only for migration)
+ reformat some code
+ add getters for fields
cleanup all gh-push-trigger descriptor related lines
- for migration process
- for changes in hooks
- for configuration logic
- change dontManageHooks=false to manageHooks=true
…nced

also fix some phrases in javadocs and help
KostyaSha added a commit that referenced this pull request Aug 11, 2015
[JENKINS-24702] Migration to credentials instead of plain token usage
@KostyaSha KostyaSha merged commit bb047ff into jenkinsci:master Aug 11, 2015
@KostyaSha KostyaSha mentioned this pull request Aug 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants