-
Notifications
You must be signed in to change notification settings - Fork 182
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
Added enhancement Sync settings after installing the integration #74
Conversation
Thanks for working on this! Cool idea! |
@jwsloan Yea this is nice idea. I will implement this and update the PR. |
Now that I think about it some more, I think this will need to involve creating |
@jwsloan I implemented that
But I did'nt get this part
Would you please explain? |
@knrt10 Hopefully that first part makes sense. The new functionality this issue describes could be looked at the same way, only in reverse. Each end point that is represented in the settings file would have a specific importer js file. Of course, that would make actually writing out the yml file a bit interesting. I could be totally wrong. And terrible at explaining it. Does it make any more sense now? |
It seems like this might be working as submitted 🎉 I totally get where you're coming from @jwsloan, but in the interest of supporting a first-time contributor in getting to a successful merge (woooo party yeah!), could we move that import/export architecture enhancement into a new ticket? I feel like you've provided an awesome description that really tees it up for the next person, if we were to copy that over? |
@knrt10 Great PR!! 🎉 EDIT: Sorry, if it's a rookie one. 😆 |
TWINS! Had the same thought, but felt like I should research before asking :) But that was prob my ego speaking..! |
@aryannarora @patcon Thanks. Whenever we want to create a github file using API our file contents should be |
index.js
Outdated
' permission: push' | ||
|
||
const base64 = require('./encode') | ||
const encodedString = base64.encode(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knrt10 instead of using some custom created Base64 encoding, you can use Node.JS's built-in Buffer
global:
const encodedString = Buffer.from(string).toString('base64')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok let me update both the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knrt10 i was asking about this only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aryannarora finally changed it.
index.js
Outdated
const getRepo = await context.github.repos.get({owner: owner, repo: repoName}) | ||
await context.github.gitdata.createReference({owner: owner, repo: repoName, ref: 'refs/heads/probot', sha: sha}) | ||
// setting the template of file | ||
const string = 'repository: \n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please move this into a separate file? It'd also be good to use a template literal to avoid all of the \n
characters. In the separate file, you can do:
module.exports = getRepo => `
name: ${getRepo.data.name}
`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooooo... I am not too proud to admit that I just learned a thing. Thanks! 🎉
@JasonEtco changed the files as you asked. Please have a look. |
@knrt10 I checked that you are listening to So if a user has no |
@itaditya Thanks. Let me update that too. |
for reference you can take a look at https://github.com/itaditya/probot-bootstrap/blob/master/index.js#L14 and https://github.com/itaditya/probot-bootstrap/blob/master/lib/onboard.js#L7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listen to installation event also
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? |
yep still relevant |
Any update on this? |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? |
yep relevant |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? |
Not at all relevant. |
Just to check in @knrt10 (I'm way out of the loop on the settings plugin, though have recommended it around) -- is this actually irrelevant, or was there frustration involved in getting it merged? I really appreciating what it added way back when I bug-tested it, so am confused why it stayed in limbo :) |
This is reference to issue #1
Added Functionalities:
When a user has a predefined
.github
folder and they install the probot/settings app after that, then 2 functionalities are added1.) If
.github
folder hassettings.yml
file then it will be automatically synced.2.) If no
settings.yml
file is found in.github
then the bot opens a PR with some default settings insettings.yml
file.3.) When PR is merged bot automatically delete the branch created by bot.