Is it possible to assign GitHub issues directly to project boards when creating the issue in Visual Studio Code using GitHub pull requests and issues? - visual-studio-code

Environment:
VSCode installed
Signed in to GitHub in VSCode
"GitHub pull requests and issues" extension installed
Single repository open that has known project boards, eg. "General"
Explanation:
If I open the Command Palette in VSCode and type "GitHub Issues: Create an issue" and press enter, a file opens. The file is called "NewIssue.md" and contains the following:
Issue Title
Assignees: Comma-separated usernames, either #username or just username.
Labels: Comma-separated labels.
<!-- Edit the body of your new issue then click the ✓ "Create Issue" button in the top right of
the editor. The first line will be the issue title. Assignees and Labels follow after a blank
line. Leave an empty line before beginning the body of the issue. -->
I am able to create an issue and body with a title as suggested in the comment block.
Is there a way to assign this to a project board within this file?
I have tried adding Projects: General below Labels:
It created the issue but did not automatically assign it to the project board.
Thanks

If you are using the beta project board, you can use this action: https://github.com/marketplace/actions/add-to-github-projects-beta to add issues to your board from a workflow.
The action is pretty well documented but the overall idea is you have a workflow that is triggered on new issues or changes to existing issue labels and if the labels match a list that you define, then the issue is added to the board.

Related

How do I trigger a Github Action on project card movement?

I need a Github action which closes an issue when that issue is moved to a "Done" column on a Github Project.
My issue is that the project_card trigger only works on "classic" projects. Github specifies this in their documentation for the project_card trigger: "This event only occurs for projects (classic)."
I would use a classic project, but unfortunately Github has made it so classic projects cannot be created for repositories unless that repo has an existing classic project. I assume this is to phase out classic projects, which is fine except for triggers like project_card which only work with them.
Hoping there is some form of solution for project_card trigger to work with non-classic Github projects in the interim?
I tried using this Github Action with a non-classic project, but the action uses the project_card trigger which led me to this issue.

Manually Assign a GitLab Project (VSCode)

I want to use the GitLab VS Code Extension with a private project.
I added my account, generated the token and saved it in VsCode.
When I click on the extension I can see the name of my project but it's marked as "no gitLab project".
When I right click on it, I can select "Manually Assign a GitLab Project" and then I have a textbox to fill. I tried with the local path of my project (where the .git file is), I tried with the link I use in the browser to get to my project and the link I use to clone it, but I always get "Cannot find project with path ..."
What's the right way of setting my project?
I had the same issue tyring to connect with , I have linked vsCode to GitLab with following steps:
On vsCode CMD + P , type: > Gitlab: Add Account to VS Code
Add URL to Gitlab instance: it is not necessarily https://gitlab.com, it could be something different, like for example https://gitlab.company-name.com/ (IMPORTANT to put the right link)
Paste your GitLab personal Access Token
In case you do not have an access token yet, just go here https://gitlab.com/-/profile/personal_access_tokens or https://gitlab.xxxxx.com/-/profile/personal_access_tokens and create new access token, you just need api & api_user that's the default, you can add more premissions if you need, put the expiration time to next month, year or whatever date in the future
Then you suppose to see the project(s) in your gitlab account on vscode.

Jira integration in Backstage giving 404 error

I'm currently testing Backstage for my company, and I tried various continuous integration pipelines like Github, Jira, Jenkins, and more. But I'm facing an issue with the Jira plugin. Maybe it's just a bad setup.
In my component, I can see the Jira entity, but every time, it says:
failed to fetch data, status 404: Not Found
When I look in the browser's console (network), I can see this 404, and this is the query used:
http://localhost:7007/api/proxy/jira/api/rest/api/latest/project/undefined
Why do I have undefined? Is it because the jira/project-key variable is not at the right place? Actually, it's in the catalog-info.yaml under metadata.
I followed all documentation I could find, but one section is not enough clear for me. It's about the annotations thing. It says `Add annotation to the yaml config file of a component. I created a component yesterday, but I don't see any file for it.
Thanks in advance.
Ok, I found the solution.
In the documentation, the file, called catalog-info.yaml, is not the one at the Backstage repository's root, but to a file in a different repository that will be used as component template in Backstage.
If you create a new repository (ex a fork from Symfony), you will have to add the file catalog-info.yaml with various informations if you want to use this repository as template for your projects.

How to display a VSTS Build Badge in a README.md file hosted on GitHub?

I have developed a tiny library that I chose to host on GitHub. The code is being built by a VSTS build and published as a NuGet package.
I have written a README.md file and I am trying to include a Build badge on it, as described in the Microsoft documentation. Consequently, I have added the following line in the MD file and replaced the placeholders accordindly:
![Build status](https://{my-organisation}.visualstudio.com/{my-project}/_apis/build/status/{my-build-definition-name}?branch=master)
The problem is that the link is not accessible to anyone that is not logged-in on VSTS and I end up with a 'broken' link on my readme page:
Question
What must be done to make the VSTS Build Badge available to a GitHub repo?
I suppose you must include an authentication token of sorts in order to have at least read-access to the VSTS build from your GitHub page.
Note that the documentation lists also multiple pending issues, including MicrosoftDocs/vsts-docs issue 1499:
Build status badge added to GitHub readme doesn't show up.
So this is still in progress.
On that last issue, it says:
This is due to public vs. private projects.
If you make your project public the image URL will render.
There are other potential workarounds we are looking at for the doc.
See "Change the project visibility, public or private".

How to create tag automatically upon accepted merge request in GitLab?

This is for a repository containing a library. The library version number is incremented (manually) each time a Merge Request to master is accepted.
However, if I want to access a file from version X.Y.Z, I have to look for the commit that incremented the version number to X.Y.Z, get its date, and then look in the history of the file for the version at that date.
I would like to create a tag per version, automatically when the Merge Request to master is created. Is this possible?
I hoped it would be possible with the new GitLab slash commands, but there currently is not support for tags.
Is there any other possibility than using web hooks?
While facing the same challenge, I stumbled upon this suggestion on GitLab's former issue tracker on GitHub1:
“You can write up a script to use GitLab API to accept a merge request, get the commit of the merge and then tag that commit.” --MadhavGitlab
(just to mention that — for me that's not sufficient)
1 EDIT:
Looks like all issues have been purged from the GitHub mirror, so this link does no longer work, but luckily the relevant quote persists right here.
I first tried to do it the gitlab way, by creating a .gitlab-ci.yml file in the project top-level directory. That file can contain the commands creating the version tag. The user executing the script has to have enough permission to push to the git project, and be configured with authoring information.
I finally did it on a Jenkins server, where I created a job that is invoked when commits are pushed into a specific branch. The tag can be created in the execute shell commands.