Is it possible to define the issue number in GitHub? - api

I would like to move from Redmine to GitHub by importing my repositories and issues.
In my commits I referenced issues by using issues numbers like #343.
Since issues number are cross project inside Redmine, I would like to change issue id in GitHub to match the same as in Redmine.
Is it possible?

Not easily. You create an issue by POSTing to /repos/:owner/:repo/issues. You can set title, body, assignee, milestone, and labels - that's it.
You might want to instead append the Redmine issue number to the GitHub title, like:
Button doesn't click [Redmine #1234]
You could also link to the old issue in the body of the issue.
See the create an issue API documentation for more details.
If that's not good enough, you should know that issue#s are auto-incrementing, so you could keep the number by POSTing them in the correct order, and POSTing and DELETEing throwaway issues for gaps in the sequence.

Related

How to get github edit history of issue and issue comments via api?

I only found api to get issue list, issue content, issue comments list and content, no issue content edit history, no issue comments edit history.
No, this cannot currently be done purely from the API.
However, if we reverse engineer the way GitHub loads past edits in the web interface, and do a bit of scraping, we can accomplish the same thing without the API. Unfortunately, this means that we don't have the reliability of an API - GitHub's web interface is liable to change at any time, breaking our code. But it's better than nothing!
So, first we need a log of all the edits for a comment. Let's do this with the comment https://github.com/seisvelas/crypsee/issues/1#issue-874033952 (from a test repo provided by the gentleman who set the bounty on this question). On order to get a log of this issue's comments, we will need to base64 encode the issue number with '05:' then the word 'Issue' at the beginning. Why '05:'? I have no idea. But it's always there and it won't work with out it. So we'll be base64 encoding the string "05:Issue874033952", which gives us MDU6SXNzdWU4NzQwMzM5NTI=
Great, now we insert MDU6SXNzdWU4NzQwMzM5NTI= into this URL scheme: https://github.com/_render_node/{BASE64 ENCODING HERE}/comments/comment_edit_history_log, resulting in a link to https://github.com/_render_node/MDU6SXNzdWU4NzQwMzM5NTI=/comments/comment_edit_history_log
Following that link, we see an edit history, but not the contents of the edits themselves:
However, this gives us the information we need! If we look at the HTML, we see that all edits prior to the current edit are defined as buttons with a link to that edit:
<button
type="button"
class="btn-link dropdown-item p-2"
role="menuitem"
data-edit-history-url="/user_content_edits/MDE1OlVzZXJDb250ZW50RWRpdElzc3VlRWRpdDo1MzIxODcxNzE="
>
The URL pointed to by the data-edit-history-url is the same URL loaded via the browser's networking tab when clicking to view a past edit in the web interface!
Unfortunately, if you attempt to view that page on it's own, you get a 404. It is intended to be viewed only from the web interface. But that's no problem, just go to the web interface, view one of the edits, and copy the headers it sends along. In my case I'm using Chromium, so I just find the request to the edit in my networking tab, right click and hit 'copy as Fetch request (nodejs)' and viola, with those headers I'm good to go!
For example, for the comment we've been using this whole time, I make that request and get back a bunch of HTML. The content of the original edit is near the end:
<ins><p class="rich-diff-level-zero">before edit</p></ins>
There it is! I could write a script to automate this, but then I'd be doing everything for you :3 Suffice it to say that with a day's work of cleverly organized scraping, this is roughly what you must to in order to view these revisions. If someone does make such a tool, the OSINT community will surely be immensely grateful!
To see the features of github api, it is better to read the following link
The best source to get the answer:
https://docs.github.com/en/rest/reference/issues
Check the issues you mentioned, ie issue comments, edit history issue, etc. in the link above
As far as I saw it is possible to receive issue comments but I did not see a section for edit history issue
I also suggest you see the following links for the edit history issue:
https://github.com/isaacs/github/issues/954

How can I take QUANTITY of all issues in GitHub API without all information about them

Have one question about GitHub API. I see that you can take all issues in JSON file by typing: http://api.github.com/users/issues - but this wil lreturn JSON file with all issues and I need only NUMBER of them. Can I take the quantity of issues of the repo without all info about them?
Need this to create pagination.
Thank you!
I found the answer. If somebody interested in:
https://api.github.com/repos/{user}/{repo} - you ahve field called "open_issues" - and there is number of all opened issues.

Opera Next extension autoupdate via update_url

I got problem with my company internal extension. They don't want to publish it, as it does gather data on external server. So I need to host it myself... but would like not to lose ability of autoupdate.
As far as I read I need to use update_url in manifest, but nothing more is said in Opera documentation...
"update_url": "http://path/to/updateInfo.xml", - as it is said in documentation page
Ok... and what should I put in that xml? Will it autoupdate or just notify users about new updates? Where do I put rest of updated files?
I tried to concat Opera itself about this question, but they don't give any contact information except something like if you have problem, ask on stackoverflow... so here I am.
If it does not work, I was thinking about really BAD method, using unsafe-eval and keeping newest version in local storage... but would rather like to avoid that.
In general the behavior is the same as for Chrome. You can base on this document: https://developer.chrome.com/extensions/autoupdate

Multiple comment plugin loading on Blogger

on my blog I’m using from a long time the IntenseDebate pluging as commenting system in place of the default one.
I would replace it with Google+ comment system but I don’t want to lose all comments already left by the users via IntenseDebate, so I would figure out if there’s any way to load on the old posts the IntenseDebate pluging in place of the default Google+.
As possible solution, I’m thinking something like a tag in the html post code that (if defined) load the IntenseDebate pluging.
What do you think?
its not posible to migrate IntenseDebate comment on google plus. Their is one solution that you can use multiple comment system in your blogger blog. just few month ago i had written trick for the same. I hope that this will be useful to you.
http://www.tipsviablogging.com/multiple-comment-system-blogspot/

How do I remove a facebook comment warning?

my fb comments code is:
<fb:comments url="<?=$this_url?>" width="600" xid="<?=$this_unique_xid?>" notify="true" candelete="true" simple="1" numposts=1 url="http://www.veethi.com"></fb:comments>
Now if i want to remove the warning message:
Warning: this comments plugin is operating in compatibility mode, but
has no posts yet. Consider specifying an explicit ‘href’ as suggested
in the comments plugin documentation to take advantage of all plugin
features
I need to replace "url" to "href", but by doing this i lose my old comments,
Is anyone who facing the problem or solution pls, reply me.
I need one solution that remove the warning message and the same way i have all my old comments.
thankx in advance.
I wrote a complete tutorial with a small use of JS to solve this issue.
Visit the tutorial
What I did was:
Set off the parse for XFBML tags in the JS SDK
Adding a function-call to the JS SDK with a date parameter that you manually set it once with a date that posts published after that date will start using the 'href' version, and posts published until that date will use the migrated version.
Adding another attribute to the fb:comments tag which is 'data-date' and in it's value you place your post date (dynamic code).
Calculating the dates in a JS code, and base on the result it's removing the not wanted attributes, and finally then it's render the XFBML tags using FB.XFBML.parse
Instead of <fb:comments ..., I used <div class="fb-comments" ... and then everything worked correctly.
https://developers.facebook.com/docs/reference/plugins/comments/
Put your website URL, set the number of posts that you want to have in comments, get the code. First part put it in header, right after <body> and the <div> in single.php (single post template). Delete </div><?php comments_template(); ?></div> and add the one from facebook ;) Works perfect for me ;)
#gil-goldshlager, thanks for this workaround, I think a lot of developers are looking for this. I myself are struggling with this since a long time on one of my sites: sharemovi.es
I think most important thing you managed is to show old vs new comments side by side.
Unfortunately the yellow box still shows up in some instances, and some comments get lost consequently :
OK: post after 12.15.2011 without comments (http://sharemovi.es/theprestige)
OK: both post + comments after 12.15.2011 (http://sharemovi.es/biutiful)
OK: both post + comments before 12.15.2011 (http://sharemovi.es/thesocialnetwork, http://sharemovi.es/battlelosangeles and http://sharemovi.es/thequickandthedead) - really nice to see those comments back!
not OK: posts before 12.15.2011 without comments - 2 problems here:
a. yellow box with "Warning: this comments plugin is operating in compatibility mode, but has no posts yet. Consider specifying an explicit 'href' as suggested in the comments plugin documentation to take advantage of all plugin features."
b. the comments for those posts/pages that were made AFTER 12.15.2011 disappear (without comments: http://sharemovi.es/fromdusktilldawn, http://sharemovi.es/waiting, with comments - I checked moderation panel - http://sharemovi.es/ellesappelaitsarah and http://sharemovi.es/thegame )
All together, I get more comments now than before, so thanks again. However the yellow box is quite ugly, doesn't look professional. Very bad design decision from Facebook!
Hopefully you can look into this, I am happy to assist where possible.
Cheers
Bob