How to list issues assigned to me on github repo along with their links - github-cli

I need to list the issues assigned to me on the github repo org/examplerepo on my terminal along with links to them. Is there some way i can do it.
I am using the blow command. its displaying the issues and issue numbers, tags etc.. in a beautiful table format , But there are no links to the issues
❯ gh -R org/examplerepo issue list --assignee "#me"
On checking with chatGPT, it suggested me to try gh issues --assignee=<your-username> --all --state=closed --format="%n%t%l%n%U" and it seems like an incorrect answer, because gh complaints there is no such flag as --format

Related

Tags feed in GitLab shows only 20 entries

I need to find a way to get all release names and release dates for a project in GitLab.
I tried retrieving Tags feed, but it seems to contain only 20 entries-so the older tags are not in the feeds.
How can i easily get those Release information for a project / Group.
I couldn't download Release_evidence JSON for each release. That's not a problem.
But I need an easy way to get all those release information.
<project>/-/tags?format=atom
only displays 20 entries.How to get all entries regarding release information easily.
The GitLab documentation helped me in this case to retrieve all feeds
This link ---> https://docs.gitlab.com/ee/api/#pagination
Scanning through the available pages using "page=n" query parameter in the URL and read the feed entries from each page until there are no feed entries helped me.
<project>/-/tags?format=atom&page=n, where n=1,2,3...
'per_page' query parameter didn't work for me. but the 'page' query parameter helped me
Hope it helps someone

Gitlab container registry tag expiration policy not working - regex format? schedule?

I'm trying the Gitlab "CI/CD > Container Registry tag expiration policy" setting, and so far it's not deleting anything. We use semantic versioning (with a "v" prepended), and my goal is to automatically delete old "patch" releases:
Keep all major & minor tags: vM.0.0 and vM.m.0.
Delete all but a few recent tags matching vM.m.p (where p is not zero)
Given that I'm enabling this new setting on an old project, it's risky to find my answer by experimentation. Even on a new project, experimenting would take a lot of effort and calendar time. A dry-run or preview option would be really nice here, so I could try out the settings without fear of deleting important tags.
I tried the following "expire" regex: v[1-9][0-9]*[.][0-9][0-9]*[.][1-9][0-9]*. So far it hasn't had any effect. Which leaves me wondering:
How often does this run? Do I just need to wait longer?
Am I mis-understanding the way this setting works?
Is my regex bad?
What regex format is expected, even?
A more complex example in the UI would be nice. https://gitlab.com/gitlab-org/gitlab/-/issues/214007#note_322637771 mentioned that, but was closed without addressing that point.
Is there any way to see feedback on this cleanup, like maybe in the project activity log?
My current approach is to tweak this setting once a day, then check my tags list the next day to see if it had any effect.
I'd appreciate general advice for verifying/troubleshooting this setting, and/or specific suggestions for how to match my particular version scheme.
Here's a screenshot of my current settings:
I eventually gave up on this and took a different approach. Probably the most frustrating part was wondering when it runs. Is it once a day at a regular time? A random time each day? Once after every push to the registry? I was never sure how long to wait and see if my settings changes made a difference.
Instead I found an API method that exposes all of the same options. I actually like the API better than a project setting
I can see more clearly how & when it runs.
I can see error messages and results.
I can track the config in git, in .gitlab-ci.yml, rather than having to document a separate project setting.
https://docs.gitlab.com/ee/api/container_registry.html#delete-registry-repository-tags-in-bulk gives an overview and some example curls. Here's how I added it to my pipeline:
# In before_script:
- apk --update add curl
...
# In the job script:
# Get registry id. Assumptions: valid response, "id" is first field, and project only has one registry.
- REGISTRY_ID=`curl --header "PRIVATE-TOKEN:$API_TOKEN" "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/registry/repositories" | cut -d, -f1 | cut -f2 -d:`
- TAGS_URL=https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/registry/repositories/$REGISTRY_ID/tags
- curl --request DELETE --data 'keep_n=10' --data 'older_than=1week' --data "name_regex_delete=v[0-9][.].*" --data "name_regex_keep=.*[.]0" --header "PRIVATE-TOKEN:$API_TOKEN" "$TAGS_URL"
Using the API, I was able to quickly figure out which regex patterns worked. It's not immediate, but it seems to take effect within a minute. I'm assuming I could take those same regexes and use them in the project settings, but I'm happier sticking with the API for now.

How to get all the tags on a specific branch with GitLabAPI

I'm new to Gitlab API, I know how to create a tag on a specific branch, let's say I have several branches on my repository, and I created several tags on each branch. Now I want get all the tags on a specific branch with GitLabAPI. I've read the Branchs API and Tags API docs carefully, however was unable to find an answer to my question. Please help me out.
I am unsure what you're trying to accomplish as you literally described your problem with one short sentence, so it will be more of a guess.
If what you want to do is to create GitLab tag for a specific commit for a specific branch, you simply do that as you can define branch when creating it. Will not post description of how it should be done as there is documentation.
With GitLabAPI(as you wanted based on you problem description) follow this link:
How to with GitLabAPI
And instead of Release tag just make same steps for any other tag. For tagging from console you should follow this one:
How to with git
If you're looking for a way to find specific tag with GitLabAPI just go that way:
Repository->Tags->Filter by tag name
Tags are unique across the whole repository.
For doing checkout from console:
git checkout <tag>
Your consternation, I believe, comes from misunderstanding the idea of tags. It's kind of a snapshot of repository at specific point, might be for release, may be for backup purposes, does not matter, it's up to you. Important part is that no matter where you will place it, it has to be unique in scope of a whole repository not just a branch you place it. There is no way to create two same tags on two different branches, git won't let you. Read info from links and everything should be clear.
If my answer is not what you were looking for, expand your question to get more proper and accurate one.

How to override View & Template

I m checking horizon documentation at docs.openstack.org/developer/horizon/.
what I am trying to do is to add more information on volumn detail page. I want create that page as tabbed page, show the current information as well as new information. Add tab, which will refreshed with regular interval.
My question is Can I do that without changing openstack code & by extending. If yes, then how can I do that. I dont want code here, but some guidance on how I am creating tab & moving existing info in one tab.
Thanks
Aniruddha
I had to do something similar for loadbalancers panel where we wanted to modify some existing tabs and also add couple of new tabs. Also, we wanted to make our changes available as a PIP package that anyone could install easily.
Checkout the repository available at https://github.com/avinetworks/avi-horizon-dashboard/
The README describes the changes users have to make in their local_settings.py to get this new code included into horizon.
Particularly, check this file that has code to weave in the code from this package into the existing horizon code:
https://github.com/avinetworks/avi-horizon-dashboard/blob/master/avidashboard/dashboards/project/init.py

Code fragment repository search on github.com

How can I search for code fragments on github.com? When I search for MSG_PREPARE in the repository ErikZalm/Marlin github shows up nothing.
I'm using the repository code search syntax described on https://github.com/search with
repo:ErikZalm/Marlin MSG_PREPARE
No results, but MSG_PREPARE can be found inside this repository here. Am I missing something? Is there no code search on github.com?
At the time of writing this answer, compared to time this question was asked i.e. about 8 years ago, github has come a good way, though still not to the length which you are looking at.
GitHub code searches are limited on the following rules: https://docs.github.com/en/github/searching-for-information-on-github/searching-code . Quoting the same:
Code in forks is only searchable if the fork has more stars than the parent repository.
Forks with fewer stars than the parent repository are not indexed for code search.
To include forks with more stars than their parent in the search results, you will need to add fork:true or fork:only to your query.
For more information, see "Searching in forks."
So we can search within the fork using the fork:true option, though as expected, since the repo ErikZalm/Marlin is low on star count as compared to parent MarlinFirmware/Marlin, the code in the fork is still not indexed. Hence the advance search shows no good except a match to the repo.
Though, if you perform the same search on the parent, it would show the matches on the code. Here are the matches for MSG_PREPARE in the parent repo MarlinFirmware/Marlin
Fortunately, one company which I know working on this domain is SourceGraph: https://about.sourcegraph.com/
Hence, you can easily search what you intended with SourceGraph:
Here are the matches for MSG_PREPARE in the ErikZalm/Marlin using SourceGraph Cloud
Update July 2013: "Preview the new Search API"
The GitHub search API on code now supports fragments, through text-match metadata.
Some API consumers will want to highlight the matching search terms when displaying search results. The API offers additional metadata to support this use case. To get this metadata in your search results, specify the text-match media type in your Accept header. For example, via curl, the above query would look like this:
curl -H 'Accept: application/vnd.github.preview.text-match+json' \
https://api.github.com/search/code?q=octokit+in:file+extension:gemspec+-repo:octokit/octokit.rb&sort=indexed
This produces the same JSON payload as above, with an extra key called text_matches, an array of objects. These objects provide information such as the position of your search terms within the text, as well as the property that included the search term.
Original answer (November 2012)
I don't think there is anything that you would have missed.
If you search for SdFile, you would find results in .pde file, but none in cpp files like in this SdFile.cpp file.
The search was introduced 4 years ago (November 2008), but, as mentioned in "Search a github repository for the file defining a given function", GitHub repository code is simply not fully indexed.

Resources