intersystems-community / vscode-objectscript

InterSystems ObjectScript extension for Visual Studio Code
https://docs.intersystems.com/components/csp/docbook/DocBook.UI.Page.cls?KEY=GVSCO
Other
108 stars 49 forks source link

Git Branch/Namespace Sync Issue #266

Closed PaulSiml closed 4 years ago

PaulSiml commented 4 years ago

In our environment, we have many Git branches in VS Code and each branch is associated to a namespace.

For example:

Branch Cache Instance A C-1 B C-2 C C-3 Etc.

When we switch branches in VS Code, it is necessary to update the setting.json file to now point at the correct namespace to keep the Git branch and Cache namespace in sync.

So if I switch to Git branch B, I have to make sure I switch to namespace, C-2, at the same time in setting.json and save it – otherwise I am pointing at the wrong namespace. Any changes I save will push/compile to the incorrect Cache instance.

Seem like we should have at least a warning prompt to change the namespace in settings.json, the capability to quickly change the server/namespace in a dialog, blank out the namespace in settings.json on a branch change, or perhaps a resource file. I have already pushed and compiled code to the wrong namespace because I forgot to update the settings.json file since it is so easy to change branches in VS Code.

daimor commented 4 years ago

It's not a common case, and I would not do it in VSCode. As you are using git, you have to look at githooks. post-checkout looks like what your really need, just add the code, which will change the namespace in settings.json according to the branch name.

If you have such way, maybe just store different settings.json in different branches?

bourette commented 4 years ago

You can just create a settings.json with the namespace defined in each branch. You don't need the full connection just the namespace.

Such as { "objectscript.conn": { "ns": "C-1" } }

Root A .vscode settings.json cls mac ...

B .vscode settings.json cls mac ...

On Aug 12, 2020, at 7:48 AM, PaulSiml notifications@github.com<mailto:notifications@github.com> wrote:

In our environment, we have many Git branches in VS Code and each branch is associated to a namespace.

For example:

Branch Cache Instance A C-1 B C-2 C C-3 Etc.

When we switch branches in VS Code, it is necessary to update the setting.json file to now point at the correct namespace to keep the Git branch and Cache namespace in sync.

So if I switch to Git branch B, I have to make sure I switch to namespace, C-2, at the same time in setting.json and save it – otherwise I am pointing at the wrong namespace. Any changes I save will push/compile to the incorrect Cache instance.

Seem like we should have at least a warning prompt to change the namespace in settings.json, the capability to quickly change the server/namespace in a dialog, blank out the namespace in settings.json on a branch change, or perhaps a resource file. I have already pushed and compiled code to the wrong namespace because I forgot to update the settings.json file since it is so easy to change branches in VS Code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3CSFU7U66QFZASGUNDSAJ6QFANCNFSM4P4SBXHA.

PaulSiml commented 4 years ago

Hi,

Thanks for taking the time to respond to our issue.

In some cases, the namespaces are on the same servers but in other cases the namespaces are on different servers. Here is an example with altered names in our settings.json file.

Here is what our single json file looks like today:

{ "objectscript.conn": { "active": true, "label": "SRV2017", "host": "SRV2017", "port": 57772, "username": "PXS", "password": "", "ns": "C-1", "https": false, },

"tfvc.location": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\TF.exe",
"objectscript.export.addCategory": true,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"git.suggestSmartCommit": false

}

If I understand you correctly, we could have a settings.json on each Git branch. As we switch branches, it picks up the settings.json associated with the branch? Does that need to be configured in VS Code/ObjectScript? Or am I missing something?

-Paul

From: bourette [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 5:41 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com Cc: Siml, Paul Paul.Siml@conduent.com; Author author@noreply.github.com Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

You can just create a settings.json with the namespace defined in each branch. You don't need the full connection just the namespace.

Such as { "objectscript.conn": { "ns": "C-1" } }

Root A .vscode settings.json cls mac ...

B .vscode settings.json cls mac ...

On Aug 12, 2020, at 7:48 AM, PaulSiml notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com>> wrote:

In our environment, we have many Git branches in VS Code and each branch is associated to a namespace.

For example:

Branch Cache Instance A C-1 B C-2 C C-3 Etc.

When we switch branches in VS Code, it is necessary to update the setting.json file to now point at the correct namespace to keep the Git branch and Cache namespace in sync.

So if I switch to Git branch B, I have to make sure I switch to namespace, C-2, at the same time in setting.json and save it – otherwise I am pointing at the wrong namespace. Any changes I save will push/compile to the incorrect Cache instance.

Seem like we should have at least a warning prompt to change the namespace in settings.json, the capability to quickly change the server/namespace in a dialog, blank out the namespace in settings.json on a branch change, or perhaps a resource file. I have already pushed and compiled code to the wrong namespace because I forgot to update the settings.json file since it is so easy to change branches in VS Code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3CSFU7U66QFZASGUNDSAJ6QFANCNFSM4P4SBXHA.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672846530&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=YCJw2NzRrnVhODHWelbq9zQKlczk4EDZ7%2FiQFXhatZk%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQQVNUX4BHHY7SCYMRDSAKEVFANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=KRN4Xfzot8M6P9NzlSB3BvF11zUsLoBLvLGPGYQ6M7s%3D&reserved=0.

bourette commented 4 years ago

You could modify the settings directly in the folder or update using the UI and assign the settings on the folder, versus workspace or user. Folder settings will override workspace settings.

James

On Aug 12, 2020, at 9:56 AM, PaulSiml notifications@github.com<mailto:notifications@github.com> wrote:

Hi,

Thanks for taking the time to respond to our issue.

In some cases, the namespaces are on the same servers but in other cases the namespaces are on different servers. Here is an example with altered names in our settings.json file.

Here is what our single json file looks like today:

{ "objectscript.conn": { "active": true, "label": "SRV2017", "host": "SRV2017", "port": 57772, "username": "PXS", "password": "", "ns": "C-1", "https": false, },

"tfvc.location": "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe", "objectscript.export.addCategory": true, "terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe", "git.suggestSmartCommit": false

}

If I understand you correctly, we could have a settings.json on each Git branch. As we switch branches, it picks up the settings.json associated with the branch? Does that need to be configured in VS Code/ObjectScript? Or am I missing something?

-Paul

From: bourette [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 5:41 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com<mailto:vscode-objectscript@noreply.github.com> Cc: Siml, Paul Paul.Siml@conduent.com<mailto:Paul.Siml@conduent.com>; Author author@noreply.github.com<mailto:author@noreply.github.com> Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

You can just create a settings.json with the namespace defined in each branch. You don't need the full connection just the namespace.

Such as { "objectscript.conn": { "ns": "C-1" } }

Root A .vscode settings.json cls mac ...

B .vscode settings.json cls mac ...

On Aug 12, 2020, at 7:48 AM, PaulSiml notifications@github.com<mailto:notifications@github.commailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com<mailto:notifications@github.com>>> wrote:

In our environment, we have many Git branches in VS Code and each branch is associated to a namespace.

For example:

Branch Cache Instance A C-1 B C-2 C C-3 Etc.

When we switch branches in VS Code, it is necessary to update the setting.json file to now point at the correct namespace to keep the Git branch and Cache namespace in sync.

So if I switch to Git branch B, I have to make sure I switch to namespace, C-2, at the same time in setting.json and save it – otherwise I am pointing at the wrong namespace. Any changes I save will push/compile to the incorrect Cache instance.

Seem like we should have at least a warning prompt to change the namespace in settings.json, the capability to quickly change the server/namespace in a dialog, blank out the namespace in settings.json on a branch change, or perhaps a resource file. I have already pushed and compiled code to the wrong namespace because I forgot to update the settings.json file since it is so easy to change branches in VS Code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3CSFU7U66QFZASGUNDSAJ6QFANCNFSM4P4SBXHA.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672846530&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=YCJw2NzRrnVhODHWelbq9zQKlczk4EDZ7%2FiQFXhatZk%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQQVNUX4BHHY7SCYMRDSAKEVFANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=KRN4Xfzot8M6P9NzlSB3BvF11zUsLoBLvLGPGYQ6M7s%3D&reserved=0.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266#issuecomment-672886234, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3AZW52YFRBYAYRQNITSAKNP3ANCNFSM4P4SBXHA.

PaulSiml commented 4 years ago

Hi James,

Thanks for your help … we will try a separate settings file on each folder.

-Paul

From: bourette [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 7:01 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com Cc: Siml, Paul Paul.Siml@conduent.com; Author author@noreply.github.com Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

You could modify the settings directly in the folder or update using the UI and assign the settings on the folder, versus workspace or user. Folder settings will override workspace settings.

James

On Aug 12, 2020, at 9:56 AM, PaulSiml notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com>> wrote:

Hi,

Thanks for taking the time to respond to our issue.

In some cases, the namespaces are on the same servers but in other cases the namespaces are on different servers. Here is an example with altered names in our settings.json file.

Here is what our single json file looks like today:

{ "objectscript.conn": { "active": true, "label": "SRV2017", "host": "SRV2017", "port": 57772, "username": "PXS", "password": "", "ns": "C-1", "https": false, },

"tfvc.location": "C:\Program Files (x86)\Microsoftfile:///\\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe", "objectscript.export.addCategory": true, "terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe", "git.suggestSmartCommit": false

}

If I understand you correctly, we could have a settings.json on each Git branch. As we switch branches, it picks up the settings.json associated with the branch? Does that need to be configured in VS Code/ObjectScript? Or am I missing something?

-Paul

From: bourette [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 5:41 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com<mailto:vscode-objectscript@noreply.github.com<mailto:vscode-objectscript@noreply.github.com%3cmailto:vscode-objectscript@noreply.github.com>> Cc: Siml, Paul Paul.Siml@conduent.com<mailto:Paul.Siml@conduent.com<mailto:Paul.Siml@conduent.com%3cmailto:Paul.Siml@conduent.com>>; Author author@noreply.github.com<mailto:author@noreply.github.com<mailto:author@noreply.github.com%3cmailto:author@noreply.github.com>> Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

You can just create a settings.json with the namespace defined in each branch. You don't need the full connection just the namespace.

Such as { "objectscript.conn": { "ns": "C-1" } }

Root A .vscode settings.json cls mac ...

B .vscode settings.json cls mac ...

On Aug 12, 2020, at 7:48 AM, PaulSiml notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com>mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com%3cmailto:notifications@github.com%3cmailto:notifications@github.com>>>> wrote:

In our environment, we have many Git branches in VS Code and each branch is associated to a namespace.

For example:

Branch Cache Instance A C-1 B C-2 C C-3 Etc.

When we switch branches in VS Code, it is necessary to update the setting.json file to now point at the correct namespace to keep the Git branch and Cache namespace in sync.

So if I switch to Git branch B, I have to make sure I switch to namespace, C-2, at the same time in setting.json and save it – otherwise I am pointing at the wrong namespace. Any changes I save will push/compile to the incorrect Cache instance.

Seem like we should have at least a warning prompt to change the namespace in settings.json, the capability to quickly change the server/namespace in a dialog, blank out the namespace in settings.json on a branch change, or perhaps a resource file. I have already pushed and compiled code to the wrong namespace because I forgot to update the settings.json file since it is so easy to change branches in VS Code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3CSFU7U66QFZASGUNDSAJ6QFANCNFSM4P4SBXHA.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672846530&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=YCJw2NzRrnVhODHWelbq9zQKlczk4EDZ7%2FiQFXhatZk%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQQVNUX4BHHY7SCYMRDSAKEVFANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=KRN4Xfzot8M6P9NzlSB3BvF11zUsLoBLvLGPGYQ6M7s%3D&reserved=0.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266#issuecomment-672886234, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3AZW52YFRBYAYRQNITSAKNP3ANCNFSM4P4SBXHA.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672889145&data=02%7C01%7Cpaul.siml%40conduent.com%7Cdf3c52278b6944c7282508d83ec82aa0%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328376716864718&sdata=Xc%2FiSeN6NpE4RmOQBccijK2oxmo%2B3d0PkQsESpl%2BzkM%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQXQQNGMPRC2PWFABV3SAKOB7ANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Cdf3c52278b6944c7282508d83ec82aa0%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328376716874712&sdata=cN4cBn%2BSSgo28UeT2Q6K1NEv6WyhDEYMjcMpMeEnHiI%3D&reserved=0.

PaulSiml commented 4 years ago

Hi Dmitry,

Thanks for your quick response.

Yes … several other people have suggested adding settings to the directory. We were not aware that it had this capability. We are going to try separate settings on each directory.

Thanks,

-Paul

From: Dmitry Maslennikov [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 5:23 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com Cc: Siml, Paul Paul.Siml@conduent.com; Author author@noreply.github.com Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

It's not a common case, and I would not do it in VSCode. As you are using git, you have to look at githooks. post-checkouthttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fschacon.github.io%2Fgit%2Fgithooks.html%23_post_checkout&data=02%7C01%7Cpaul.siml%40conduent.com%7Ceec6b4ed7a6f48eb064108d83eba8425%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328318085343196&sdata=EgyvqnCl2RS4DVzHRgw9iJmImhcIDGrdzklmjYaY25M%3D&reserved=0 looks like what your really need, just add the code, which will change the namespace in settings.json according to the branch name.

If you have such way, maybe just store different settings.json in different branches?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672838360&data=02%7C01%7Cpaul.siml%40conduent.com%7Ceec6b4ed7a6f48eb064108d83eba8425%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328318085353191&sdata=nBSEGtKOklSdfowsCSuQjtzk1JnJVePsj7TTg%2B27NJ4%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQTKTJUGXZ5GE2WDIHDSAKCTZANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Ceec6b4ed7a6f48eb064108d83eba8425%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328318085353191&sdata=CoCn8EkIwhSchraz%2FjxW6SQcUJTQ376vYsBwhPhOVck%3D&reserved=0.

gjsjohnmurray commented 4 years ago

@PaulSiml can this be closed?

PaulSiml commented 4 years ago

Hi Dmitry,

Does this mean I could remove all settings.json files (user, workspace) and simply have a json file on a git branch?

So far, I have not been able to make this work. VS Code\ObjectScript cannot seem to find the settings file on the Git Branch. What am I doing wrong? (I am using the latest version 8.9)

-Paul

From: Dmitry Maslennikov [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 5:23 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com Cc: Siml, Paul Paul.Siml@conduent.com; Author author@noreply.github.com Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

It's not a common case, and I would not do it in VSCode. As you are using git, you have to look at githooks. post-checkouthttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fschacon.github.io%2Fgit%2Fgithooks.html%23_post_checkout&data=02%7C01%7Cpaul.siml%40conduent.com%7Ceec6b4ed7a6f48eb064108d83eba8425%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328318085343196&sdata=EgyvqnCl2RS4DVzHRgw9iJmImhcIDGrdzklmjYaY25M%3D&reserved=0 looks like what your really need, just add the code, which will change the namespace in settings.json according to the branch name.

If you have such way, maybe just store different settings.json in different branches?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672838360&data=02%7C01%7Cpaul.siml%40conduent.com%7Ceec6b4ed7a6f48eb064108d83eba8425%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328318085353191&sdata=nBSEGtKOklSdfowsCSuQjtzk1JnJVePsj7TTg%2B27NJ4%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQTKTJUGXZ5GE2WDIHDSAKCTZANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Ceec6b4ed7a6f48eb064108d83eba8425%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328318085353191&sdata=CoCn8EkIwhSchraz%2FjxW6SQcUJTQ376vYsBwhPhOVck%3D&reserved=0.

PaulSiml commented 4 years ago

Hi John,

Not yet …. I am following up with Dmitry. So far, I have not been able to make the settings.json file on a Git branch work. (I must be doing something wrong)

-Paul

From: John Murray [mailto:notifications@github.com] Sent: Friday, August 14, 2020 3:07 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com Cc: Siml, Paul Paul.Siml@conduent.com; Mention mention@noreply.github.com Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

@PaulSimlhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPaulSiml&data=02%7C01%7Cpaul.siml%40conduent.com%7C9cadfc7dfc994ab2e62008d84039d7b8%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637329964460899615&sdata=v0%2B4kSO1toOeWMsEpYqhYw%2FzOUugNdm0ddPtzDNTwAs%3D&reserved=0 can this be closed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-673999949&data=02%7C01%7Cpaul.siml%40conduent.com%7C9cadfc7dfc994ab2e62008d84039d7b8%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637329964460909615&sdata=vLoePWOEXIlsyQGVZYhnUTPcfYslu1Ew0dWhvCiFH30%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQUBWNLGG3FGGDEUO5DSAUEFXANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7C9cadfc7dfc994ab2e62008d84039d7b8%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637329964460909615&sdata=qVfjP93YXGUF2PCfbuO%2FmV0v6HKcsoTWcDdYJp3j5Mw%3D&reserved=0.

daimor commented 4 years ago

It seems that you misunderstood something. What doing you mean by git branch?

Basically it means, that different branches just may have some changes in the same files.

So, for instance, you should have ‘.vscode/settings.json’ in any of your branches, but it have different namespace value. Or it could be ‘code-workspace’ file.

PaulSiml commented 4 years ago

Hi James,

As a test, I deleted all settings.json files (user and workspace) and only put a single settings.json file, with all connection info, on the Git branch at the same level as the src folder/.vscode expecting it to find and use the connection information. However it does not.

I also tried just a setting.json file on the workspace and a setting.json files on the Git branch with just the NS info. It does not seem to honor the settings.json file on the git branch.

So it does not seem to over-ride any settings files nor does it seem to find the settings file on a Git branch.

I am running ObjectScript 8.9 on a TFS Git Repo.

Am I missing something?

-Paul

From: bourette [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 7:01 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com Cc: Siml, Paul Paul.Siml@conduent.com; Author author@noreply.github.com Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

You could modify the settings directly in the folder or update using the UI and assign the settings on the folder, versus workspace or user. Folder settings will override workspace settings.

James

On Aug 12, 2020, at 9:56 AM, PaulSiml notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com>> wrote:

Hi,

Thanks for taking the time to respond to our issue.

In some cases, the namespaces are on the same servers but in other cases the namespaces are on different servers. Here is an example with altered names in our settings.json file.

Here is what our single json file looks like today:

{ "objectscript.conn": { "active": true, "label": "SRV2017", "host": "SRV2017", "port": 57772, "username": "PXS", "password": "", "ns": "C-1", "https": false, },

"tfvc.location": "C:\Program Files (x86)\Microsoftfile:///\\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe", "objectscript.export.addCategory": true, "terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe", "git.suggestSmartCommit": false

}

If I understand you correctly, we could have a settings.json on each Git branch. As we switch branches, it picks up the settings.json associated with the branch? Does that need to be configured in VS Code/ObjectScript? Or am I missing something?

-Paul

From: bourette [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 5:41 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com<mailto:vscode-objectscript@noreply.github.com<mailto:vscode-objectscript@noreply.github.com%3cmailto:vscode-objectscript@noreply.github.com>> Cc: Siml, Paul Paul.Siml@conduent.com<mailto:Paul.Siml@conduent.com<mailto:Paul.Siml@conduent.com%3cmailto:Paul.Siml@conduent.com>>; Author author@noreply.github.com<mailto:author@noreply.github.com<mailto:author@noreply.github.com%3cmailto:author@noreply.github.com>> Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

You can just create a settings.json with the namespace defined in each branch. You don't need the full connection just the namespace.

Such as { "objectscript.conn": { "ns": "C-1" } }

Root A .vscode settings.json cls mac ...

B .vscode settings.json cls mac ...

On Aug 12, 2020, at 7:48 AM, PaulSiml notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com>mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com%3cmailto:notifications@github.com%3cmailto:notifications@github.com>>>> wrote:

In our environment, we have many Git branches in VS Code and each branch is associated to a namespace.

For example:

Branch Cache Instance A C-1 B C-2 C C-3 Etc.

When we switch branches in VS Code, it is necessary to update the setting.json file to now point at the correct namespace to keep the Git branch and Cache namespace in sync.

So if I switch to Git branch B, I have to make sure I switch to namespace, C-2, at the same time in setting.json and save it – otherwise I am pointing at the wrong namespace. Any changes I save will push/compile to the incorrect Cache instance.

Seem like we should have at least a warning prompt to change the namespace in settings.json, the capability to quickly change the server/namespace in a dialog, blank out the namespace in settings.json on a branch change, or perhaps a resource file. I have already pushed and compiled code to the wrong namespace because I forgot to update the settings.json file since it is so easy to change branches in VS Code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3CSFU7U66QFZASGUNDSAJ6QFANCNFSM4P4SBXHA.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672846530&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=YCJw2NzRrnVhODHWelbq9zQKlczk4EDZ7%2FiQFXhatZk%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQQVNUX4BHHY7SCYMRDSAKEVFANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=KRN4Xfzot8M6P9NzlSB3BvF11zUsLoBLvLGPGYQ6M7s%3D&reserved=0.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266#issuecomment-672886234, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3AZW52YFRBYAYRQNITSAKNP3ANCNFSM4P4SBXHA.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672889145&data=02%7C01%7Cpaul.siml%40conduent.com%7Cdf3c52278b6944c7282508d83ec82aa0%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328376716864718&sdata=Xc%2FiSeN6NpE4RmOQBccijK2oxmo%2B3d0PkQsESpl%2BzkM%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQXQQNGMPRC2PWFABV3SAKOB7ANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Cdf3c52278b6944c7282508d83ec82aa0%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328376716874712&sdata=cN4cBn%2BSSgo28UeT2Q6K1NEv6WyhDEYMjcMpMeEnHiI%3D&reserved=0.

PaulSiml commented 4 years ago

Hi James,

After more experimentation, I was able to get the settings into the Git branch correctly.

Since we have many servers and namespaces, we are still attempting to work out how to handle the setting file when switching branches.

Thanks for your help.

I appreciate it.

-Paul

From: bourette [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 7:01 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com Cc: Siml, Paul Paul.Siml@conduent.com; Author author@noreply.github.com Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

You could modify the settings directly in the folder or update using the UI and assign the settings on the folder, versus workspace or user. Folder settings will override workspace settings.

James

On Aug 12, 2020, at 9:56 AM, PaulSiml notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com>> wrote:

Hi,

Thanks for taking the time to respond to our issue.

In some cases, the namespaces are on the same servers but in other cases the namespaces are on different servers. Here is an example with altered names in our settings.json file.

Here is what our single json file looks like today:

{ "objectscript.conn": { "active": true, "label": "SRV2017", "host": "SRV2017", "port": 57772, "username": "PXS", "password": "", "ns": "C-1", "https": false, },

"tfvc.location": "C:\Program Files (x86)\Microsoftfile:///\\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe", "objectscript.export.addCategory": true, "terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe", "git.suggestSmartCommit": false

}

If I understand you correctly, we could have a settings.json on each Git branch. As we switch branches, it picks up the settings.json associated with the branch? Does that need to be configured in VS Code/ObjectScript? Or am I missing something?

-Paul

From: bourette [mailto:notifications@github.com] Sent: Wednesday, August 12, 2020 5:41 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com<mailto:vscode-objectscript@noreply.github.com<mailto:vscode-objectscript@noreply.github.com%3cmailto:vscode-objectscript@noreply.github.com>> Cc: Siml, Paul Paul.Siml@conduent.com<mailto:Paul.Siml@conduent.com<mailto:Paul.Siml@conduent.com%3cmailto:Paul.Siml@conduent.com>>; Author author@noreply.github.com<mailto:author@noreply.github.com<mailto:author@noreply.github.com%3cmailto:author@noreply.github.com>> Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

You can just create a settings.json with the namespace defined in each branch. You don't need the full connection just the namespace.

Such as { "objectscript.conn": { "ns": "C-1" } }

Root A .vscode settings.json cls mac ...

B .vscode settings.json cls mac ...

On Aug 12, 2020, at 7:48 AM, PaulSiml notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com>mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com%3cmailto:notifications@github.com%3cmailto:notifications@github.com>>>> wrote:

In our environment, we have many Git branches in VS Code and each branch is associated to a namespace.

For example:

Branch Cache Instance A C-1 B C-2 C C-3 Etc.

When we switch branches in VS Code, it is necessary to update the setting.json file to now point at the correct namespace to keep the Git branch and Cache namespace in sync.

So if I switch to Git branch B, I have to make sure I switch to namespace, C-2, at the same time in setting.json and save it – otherwise I am pointing at the wrong namespace. Any changes I save will push/compile to the incorrect Cache instance.

Seem like we should have at least a warning prompt to change the namespace in settings.json, the capability to quickly change the server/namespace in a dialog, blank out the namespace in settings.json on a branch change, or perhaps a resource file. I have already pushed and compiled code to the wrong namespace because I forgot to update the settings.json file since it is so easy to change branches in VS Code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3CSFU7U66QFZASGUNDSAJ6QFANCNFSM4P4SBXHA.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672846530&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=YCJw2NzRrnVhODHWelbq9zQKlczk4EDZ7%2FiQFXhatZk%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQQVNUX4BHHY7SCYMRDSAKEVFANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Cbbaf52345f9a497c926208d83ebcf3aa%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328328545188373&sdata=KRN4Xfzot8M6P9NzlSB3BvF11zUsLoBLvLGPGYQ6M7s%3D&reserved=0.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/intersystems-community/vscode-objectscript/issues/266#issuecomment-672886234, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB4JU3AZW52YFRBYAYRQNITSAKNP3ANCNFSM4P4SBXHA.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-672889145&data=02%7C01%7Cpaul.siml%40conduent.com%7Cdf3c52278b6944c7282508d83ec82aa0%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328376716864718&sdata=Xc%2FiSeN6NpE4RmOQBccijK2oxmo%2B3d0PkQsESpl%2BzkM%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQXQQNGMPRC2PWFABV3SAKOB7ANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7Cdf3c52278b6944c7282508d83ec82aa0%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637328376716874712&sdata=cN4cBn%2BSSgo28UeT2Q6K1NEv6WyhDEYMjcMpMeEnHiI%3D&reserved=0.

PaulSiml commented 4 years ago

Hi John,

This can be closed now. We found a solution with help from James and Dmitry using cascading settings files. We put the server connection information in a workspace settings.json file and store in a Git branch. Then we put username/password connection information in the user settings.json file.

-Paul

From: John Murray [mailto:notifications@github.com] Sent: Friday, August 14, 2020 3:07 AM To: intersystems-community/vscode-objectscript vscode-objectscript@noreply.github.com Cc: Siml, Paul Paul.Siml@conduent.com; Mention mention@noreply.github.com Subject: Re: [intersystems-community/vscode-objectscript] Git Branch/Namespace Sync Issue (#266)

@PaulSimlhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPaulSiml&data=02%7C01%7Cpaul.siml%40conduent.com%7C9cadfc7dfc994ab2e62008d84039d7b8%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637329964460899615&sdata=v0%2B4kSO1toOeWMsEpYqhYw%2FzOUugNdm0ddPtzDNTwAs%3D&reserved=0 can this be closed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintersystems-community%2Fvscode-objectscript%2Fissues%2F266%23issuecomment-673999949&data=02%7C01%7Cpaul.siml%40conduent.com%7C9cadfc7dfc994ab2e62008d84039d7b8%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637329964460909615&sdata=vLoePWOEXIlsyQGVZYhnUTPcfYslu1Ew0dWhvCiFH30%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPS7NQUBWNLGG3FGGDEUO5DSAUEFXANCNFSM4P4SBXHA&data=02%7C01%7Cpaul.siml%40conduent.com%7C9cadfc7dfc994ab2e62008d84039d7b8%7C1aed4588b8ce43a8a775989538fd30d8%7C0%7C0%7C637329964460909615&sdata=qVfjP93YXGUF2PCfbuO%2FmV0v6HKcsoTWcDdYJp3j5Mw%3D&reserved=0.