VSTS git submodule reference error - azure-devops

I have a CoreApp project (CoreApp) and a Project1 that depends on the CoreApp Project. Thanks to someone from MSFT on SO, previously I was able to get this compiled with VSTS git using the (CoreApp)submodule under Project1. However, now in Project1, whenever I reference a model in the CoreApp Project (eg., a AppUser class), I get the build error - "The type or namespace name 'AppUser' could not be found (are you missing a using directive or an assembly reference?)" error. I read some SO posts and changed not only the folder name but also the CoreApp Model namespace in the CoreApp project, and now I got a different error - "The type or namespace name 'CoreAppModels' does not exist in the namespace 'CoreAppApp' (are you missing an assembly reference?) [d:\a\1\Project1\Project1.csproj]. I also continue to get the previous error. It seems to me that the build process is not picking up the CoreApp assembly, or the updated code, but I did see that the CoreApp project was pulled down during the build process.
All of this works and builds fine on my PC. I verified that on VSTS, I have the CoreApp file with the hash, and the .gitmodules with the entry -
[submodule "Project1/CoreApp"]
path = Project1/CoreApp
url = https://name.visualstudio.com/_git/CoreApp
Again, I do see that the CoreApp is pulled down during the build -
Copying file from "obj\Release\CoreApp.dll" to "bin\CoreApp.dll".
CoreApp -> d:\a\1\s\Project1\CoreApp\bin\CoreApp.dll
Does the build process on VSTS pull down the latest submodule code when doing a build? Does anyone know what I am doing wrong? I am pulling my hair out and any help is appreciated. Thank you!

Please check your VSTS build definition:
In Get source step -> show the advanced settings -> make sure the Checkout submodules is selected -> Save.
Then build your project1 again, the Project1\CoreApp\bin\CoreApp.dll will be found from submodule.
To update sumodules in main repo, you can add a Command Line task after Get sources step:
Tool: git
Arguments: submodule foreach "git pull origin master"

Related

Ambiguous project name during nuget restore

I have this repoon github: https://github.com/fgaravaglia/Umbrella.Infrastructure.Firestore
project A is published on nuget
project B.Tests is referencing ProjectA locally (not by nuget)
during CI build, I got error Ambiguous project name when restoring test project.
any suggestion?
I already changed PackageId tag on source proejct and rechange during CI build, but it didn't worked

TF200016: The following project does not exist: ProjectFirstPartOfTheName. Verify that the name of the project is correct and that the project exists

I configuring repository permissions by usin tf git permission tool in this way:
tf git permission /deny:CreateBranch /group:"[%1]\Contributors" /collection:https://dev.azure.com/<CompanyName>/ /teamproject:"%2" /repository:%3
It works fine but when the project has spaces in the name it fails with the error of the subject. I attempted with (for the first parameter, %1):
"Project Name"
Project%20Name and "Project%20Name" as it appears in the browser's address bar.
No matter what I do the error is the same, it only recognizes the first part before the blank:
"TF200016: The following project does not exist: Project. Verify that the name of the project is correct and that the project exists on the specified Azure DevOps Server."
I do not use spaces in the names of new projects but this one already existed and I would like to keep as the teams know it.
Thanks in advance.

Attempts to push Spring Boot to Git repository fails

I have a working Spring Boot application that I created in Eclipse that I wold like to put into a new Git repository.
Unfortunately, I cannot seem to do this using Eclipse (or any other Git tool).
I am using Eclipse v2019-06 (4.12.0) and the Spring Tool Suite (STS) v4.3.1
To illustrate the problem, I take the following steps:
I create the Spring Boot project using STS:
Click on "Create a Project"->"Spring Boot"->"Spring Starter Project"
Project name is GitProject
Nothing fancy in this project. Createed a HelloController class that returned some HTML. Ran a browser to test it and displayed a "greeting" web page.
Compile project
mvnw clean package
Successful compile. Ran and successfully displayed web page:
java -jar GitProject-0.0.1-SNAPSHOT.jar
The project is successful and the service works. Place project into Git
There are procedures described to create and push to new repositories. Based on procedures provided in Stack Overflow answers, perform the following:
Create the repository
git init
Make it bare
git init --bare
Create a basic README file for adding to the repository
echo Testing > README
Add and commit the README file
git add README
git commit -m "Initial Code"
Now put the project into the repository. Or at least, attempt to...
Create a project in a different folder, importing from the new repository
Click on "Import projects..."->"Projects from Git"
Clone the URI from the new repository, Only the master branch is available. Place the destination in the project folder. Because there is no existing project in the new repo, and since the IDE does not offer a way to successfully create a new Spring Boot project from a repo (I made several attempts to use the New Project Wizard to create an STS project when creating the repo. Every attempt led to different Exceptions being thrown while creating the project), select "Import as General Project" in the "Select a Wizard" dialog.
Go to the folder with the original GitProject project. Copy everything from that folder and paste it onto the new project
Edit the .gitignore file that gets included in the Spring Boot project. It is important to remove all references to the STS files except for the .sts4-cache file. These need to be saved at least once in order to ensure that the Spring Boot information is saved in the repository.
Right- click on the project and select Team->Commit
Stage everything, enter a commit message, then click on "Commit and Push"
See the following failure:
master-master [remote rejected]
Repository
branch is currently checked out
error: refusing to update checked out branch: refs/heads/master
error: By default, updating the current branch in a non-bare repository
is denied, because it will make the index and work tree inconsistent
with what you pushed, and will require 'git reset --hard' to match
the work tree to HEAD.
You can set the 'receive.denyCurrentBranch' configuration variable
to 'ignore' or 'warn' in the remote repository to allow pushing into
its current branch; however, this is not recommended unless you
arranged to update its work tree to match what you pushed in some
other way.
To squelch this message and still keep the default behaviour, set
'receive.denyCurrentBranch' configuration variable to 'refuse'.
What is strange is that somehow this branch remains "checked out" after being cloned but the IDE does not appear to provide a way to "check it back in". Worse: I actually tried just cloning the new repo, changing the README file, then committing and pushing it (without including the Spring Boot code) and that attempt yielded the same failure.
So how do I get this code committed and pushed into my repository? What step is missing from the documentation of how to do this???

Teamcity "Failed to find Visual Studio .sln file" error

I wrote the right path to github project in teamcity:
But i am getting the folowing error:
Teamcity don't fetch the content from the github path.
Do i need to do something else?
If you add the VCS root to your version control settings in the build configuration, it will extract the source code onto disk.
TeamCity documentation - Configuring VCS Settings
Hope this helps

Getting an API set up from GitHub

I've set up my github account and I'm ready to go. I'm trying to follow these instructions, for setting up an API wrapper for an iPhone project using Soundcloud, but I'm a bit lost:
1. Go to your project directory.
2. Add the Cocoa API Wrapper as a Git Subproject
git submodule add git://github.com/soundcloud/cocoa-api-wrapper.git SoundCloudAPI
3. Update the Subprojects (the API Wrapper includes the NXOAuth2Framework as a subproject)
git submodule update --init --recursive
My questions are: Where do I go in my project directory? The same level as the XCode project file? Also, the command in #2 doesn't really work for me. I get the error:
fatal: Not a git repository (or any of the parent directories): .git
Am I missing something?
These instructions assume that you're using git for your project. And according to the error message, you don't. So, probably, you want at least to git init your project, but probably you will want more.
As for where to go in your project — where you want the SoundCloudAPI to reside. Which will be created in the current directory.