Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: vscode remote container support #1481

Merged
merged 1 commit into from
Oct 6, 2020
Merged

Conversation

laurb9
Copy link
Contributor

@laurb9 laurb9 commented Sep 8, 2020

What does this do

Add support for Visual Studio Code with In-Container Development.

Why

  • Makes it easy to start developing prebid-server on any OS that supports Docker, without having to install any other dependencies on the host. Developing in a container isolates the dev environment from the host and is easy to reset or duplicate for checking other PRs etc.

I've added a small VSCODE.md for orientation.

The rest are applicable to on-host vscode development too:

  • There is an in-IDE visual debugger
  • Individual tests can be run or debug directly from the IDE.
  • Style is enforced by the Golang plugin (naming, comments, imports, errors etc). The Golang plugin for VSCode is maintained by the Google folks.

Here is a screenshot showing most of the features in a squeezed window.
Screen Shot 2020-09-03 at 5 43 59 PM

One drawback that I noticed is that if the container is cpu-limited, and it usually is, the tests will need a timeout longer than 10min sometimes to avoid failures.

Copy link
Contributor

@SyntaxNode SyntaxNode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a cool dev setup. I also think this won't be what everyone wants to work with. How do you feel about adding this primarily as markdown with sample json file contents along with instructions?

.vscode/launch.json Outdated Show resolved Hide resolved
.devcontainer/Dockerfile Show resolved Hide resolved
@laurb9
Copy link
Contributor Author

laurb9 commented Sep 10, 2020

I think this is a cool dev setup. I also think this won't be what everyone wants to work with. How do you feel about adding this primarily as markdown with sample json file contents along with instructions?

Can the sample files be in .devcontainer ? :) I can remove the extra .vscode stuff.

I don't mind this not being merged at all, as I wrote it's just a suggestion; but from my experience, spinning up the IDE with dependencies and the right extensions to get to trying out changes, would've been a decent bonus when I started.

@stale
Copy link

stale bot commented Sep 20, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 20, 2020
@stale stale bot removed the stale label Sep 28, 2020
Copy link
Collaborator

@bsardo bsardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is pretty cool and I think it's worth merging as long as it's opt-in.

.gitignore Show resolved Hide resolved
VSCODE.md Outdated Show resolved Hide resolved
Copy link
Contributor

@SyntaxNode SyntaxNode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We (finally) got around to discussing this PR. We think it's great to offer guidance for devs who want to use this feature. Let's just leave the default vscode setup alone for now.

VSCODE.md Outdated Show resolved Hide resolved
Why:
The vscode Golang plugin enforces style, identifies errors and
has a remote debugger.
Developing in a container isolates the dev environment from the host machine.
@laurb9 laurb9 requested a review from bsardo October 5, 2020 16:31
@SyntaxNode SyntaxNode merged commit 853ed6f into prebid:master Oct 6, 2020
@laurb9 laurb9 deleted the vscode branch October 14, 2020 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants