Skip to content

feat: show service banner in SSH/TTY sessions #8186

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

Merged
merged 14 commits into from
Jun 30, 2023

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Jun 23, 2023

  • Show banner
  • Test banner
  • Handle non-enterprise (from what I can tell our pattern is to just check the 404?)
  • Test auth changes
  • Parse markdown?

Closes #7652.

@code-asher code-asher force-pushed the asher/ssh-service-banners branch 4 times, most recently from 5a2e03f to c16805c Compare June 24, 2023 00:06
@code-asher code-asher marked this pull request as ready for review June 24, 2023 00:28
@code-asher code-asher requested a review from mafredri June 24, 2023 00:28
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Nice feature and test coverage!

I would approve the change, but I think we should try to find a way to avoid the slow-down in initializing SSH sessions (see comment).

@code-asher code-asher force-pushed the asher/ssh-service-banners branch from f19debb to 8a13cdb Compare June 27, 2023 21:39
@code-asher code-asher marked this pull request as draft June 27, 2023 22:51
@code-asher code-asher force-pushed the asher/ssh-service-banners branch from 8a13cdb to f649d3d Compare June 28, 2023 21:23
@code-asher code-asher force-pushed the asher/ssh-service-banners branch 4 times, most recently from a4a3cbf to e72abbb Compare June 28, 2023 21:57
We need to provide the banner in the test so I changed the manifest
argument to support passing in the client.

We could not set the banner func afterward like I was doing before
because by that point the banner will already have fetched and will not
update until the next interval.

The test interval func also changes since I wanted to have a 15 second
interval but that meant 1.5 seconds in the test which is way too long.
@code-asher code-asher force-pushed the asher/ssh-service-banners branch from e72abbb to 352af1d Compare June 28, 2023 22:38
@code-asher
Copy link
Member Author

Rebased to resolve a conflict but only the new commits are affected; the original two are still the same.

The banner is now polled (15 second interval at the moment). I think pushing is better but the polling seemed easier. I am open to pushing instead, just need to figure out the best way to do that. Maybe just a new endpoint and coderd iterates over workspace agents and hits that endpoint on each to update the banner?

@code-asher code-asher marked this pull request as ready for review June 28, 2023 23:32
@code-asher code-asher requested a review from mafredri June 28, 2023 23:32
Copy link
Member

@mafredri mafredri 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 polling is fine for now! Sorry I sent you on the wrong path with the metadata/manifest. I was under the impression we updated it periodically but it seems we usually only do it once at startup.

A few more comments but I don't think any major changes are necessary here 👍🏻

I managed to lose this in a scuffle.
Also trim to avoid adding too many newlines.
The panic might also be because you made the agent optional.
@code-asher
Copy link
Member Author

code-asher commented Jun 29, 2023

Sorry I sent you on the wrong path with the metadata/manifest.

Not at all! It was still extremely useful since I was basically able to copy what we did for the manifest then just add an extra polling loop. <3

@code-asher code-asher force-pushed the asher/ssh-service-banners branch from 8add21f to 5a3d61d Compare June 29, 2023 20:41
@code-asher code-asher force-pushed the asher/ssh-service-banners branch from 5a3d61d to 6500698 Compare June 29, 2023 20:49
@code-asher
Copy link
Member Author

Not entirely sure what is going on with the Datadog update step but the tests seem to be passing, at least.

@code-asher code-asher requested a review from mafredri June 29, 2023 23:16
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Nice work!

@code-asher code-asher merged commit 6015319 into main Jun 30, 2023
@code-asher code-asher deleted the asher/ssh-service-banners branch June 30, 2023 18:41
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2023
@matifali
Copy link
Member

Awesome ♥️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show service banners in SSH/TTY sessions
3 participants