alefragnani / vscode-jenkins-status

Jenkins Status Extension for Visual Studio Code
MIT License
27 stars 20 forks source link

Does this work for multi root projects? #39

Closed Holo-Viktor closed 4 years ago

Holo-Viktor commented 4 years ago

I get the "The project is not enabled for Jenkins. Missing .jenkins file." warning, even with the .jenkins file being in one of the workspace folders (the same folder .code-workspace is in)

project - .jenkins - project.code-workspace docs tests ...

I also tried putting it in the .vscode folder but that didn't do anything

alefragnani commented 4 years ago

Hi @Holo-Viktor ,

It should work on multi-root projects, but it have a dynamic behaviour. I mean, it checks for the .jenkins at each root folder, when you open a file inside that root folder. The location of the .code-workspace file is not relevant.

For instance, in your case, when you open any file inside the project root folder, it will display the status bar for the .jenkins file inside of it. When you open any file inside the docs folder, it will display the status bar for the .jenkins file inside of it, and so on.

Hope this helps

Holo-Viktor commented 4 years ago

Then this is a bug report instead of a feature request because I get this warning and it does not work...

I get the "The project is not enabled for Jenkins. Missing .jenkins file." warning, even with the .jenkins file being in one of the workspace folders

alefragnani commented 4 years ago

Hi @Holo-Viktor ,

I couldn't reproduce the error, using a similar structure. I created this workspace structure:

  /project-one
    .jenkins
  /project-two
     .jenkins
  /project-tree
   - no-jenkins-file

When opening any file inside project-one or project-two root folders, the Jenkins statusbar appeared and I could call the Jenkins: commands. But when I open a file which is inside project-tree, I received the same warning (which is expected).

To be able to determine which Jenkins file to use, you must navigate to any of the supported root folders. If you dont have any file opened and try to run any Jenkins command, it will also display the same Warning.

Try to open the root folders alone (single project) in VS Code, to check if the extension is able to detect the Jenkins file properly.

Hope this helps

Holo-Viktor commented 4 years ago

Even with a single root folder i keep getting the warning... As of right now the content of the .jenkins (url, username & password) has placeholder values, could this create this warning as well? If so, there should be better error handling / feedback.

alefragnani commented 4 years ago

That's really weird šŸ˜•

A malformed .jenkins file will not raise this message. This message only happens if the extension don't find a .jenkins file in the root path of the project that you opened. Or in any root folder when you open a Workspace.

If you see this message, I suppose you are trying to execute some of the commands available from this extension. Are you seeing the Jenkins status bar when you open a folder which contains the .jenkins file? If yes, it means VS Code found a .jenkins file in the root folder of your project, otherwise, it didn't findt, and any command you execute from the extension will raise that message.

Be sure the file is named .jenkins(dot-jenkins -> no name, just extension). BTW, which OS are you using?

Holo-Viktor commented 4 years ago

no status bar, every command raises the message, I'm on Win 10.0.17763 with vscode 1.38.1, the file is called .jenkins, just the extension, like .gitignore

alefragnani commented 4 years ago

Well, in this case is not only the extension which is not finding the file, but VSCode itself too.

VSCode has the ability to activate the extension if ā€œcertain fileā€ exists in the folder, and in this case it is not finding too.

Really weird...

alefragnani commented 4 years ago

Hi @Holo-Viktor ,

Are you still having this issue? Have you managed to understand why VS Code didnā€™t recognize your files inside each root folder in your workspace?

Thank you

alefragnani commented 4 years ago

I'm closing this issue because no new comments has been made since my last question. Feel free to reopen/comment if the error still occurs.