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

feat: add --head and --tail to logs command #1629

Merged
merged 25 commits into from
Apr 22, 2024

Conversation

biplab5464
Copy link
Contributor

Description of change

Addition of head and taill arguments in the Cargo shuttle log command

@chesedo chesedo changed the title Issue 1600 feat: add --head and --tail to logs command Feb 27, 2024
@biplab5464 biplab5464 marked this pull request as ready for review February 28, 2024 11:27
@biplab5464
Copy link
Contributor Author

Hello, is my pr ready to be merged

Copy link
Contributor

@oddgrd oddgrd left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @biplab5464! I left a first round of comments, but it is a bit difficult to review some of the files since there are a lot of unrelated changes. It seems like a merge error, where you have overwritten the git history and changed the author to yourself, but I'm not quite sure yet, as I don't see any force pushes. Let us know if you have questions, and we can try to help you figure this out. See comments on the files in question.

proto/logger.proto Outdated Show resolved Hide resolved
cargo-shuttle/src/args.rs Outdated Show resolved Hide resolved
Comment on lines 184 to 188
let path = match mode {
"head" => format!("/projects/{project}/deployments/{deployment_id}/logs?head={len}"),
"tail" => format!("/projects/{project}/deployments/{deployment_id}/logs?tail={len}"),
_ => format!("/projects/{project}/deployments/{deployment_id}/logs"),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use something like this here instead: https://stackoverflow.com/a/30154791. We should also consider creating an enum for mode and putting it in common, so we can use it everywhere we need it.

cargo-shuttle/src/lib.rs Outdated Show resolved Hide resolved
deployer/src/handlers/mod.rs Show resolved Hide resolved
@biplab5464
Copy link
Contributor Author

i was not active for some days, i saw it today, i will work on the changes you mentioned

and i haven't did anything to the git history, nothing of my knowledge

i was asked to just work on normal log and leave the follow log so i had improvised this,

can we talk on discord for helping me a little

@oddgrd
Copy link
Contributor

oddgrd commented Mar 8, 2024

i was not active for some days, i saw it today, i will work on the changes you mentioned

and i haven't did anything to the git history, nothing of my knowledge

i was asked to just work on normal log and leave the follow log so i had improvised this,

can we talk on discord for helping me a little

Hey @biplab5464, feel free to reach out in the contributors channel if you want more synchronous communication! Regarding the large diffs in this PR, a colleague pointed out that it may be caused by how windows handles line breaks. I found this article on the subject: https://medium.com/bootdotdev/how-to-get-consistent-line-breaks-in-vs-code-lf-vs-crlf-e1583bf0f0b6, I would try this out on your system to see if it removes the extra changes in the cargo-shuttle args.rs and lib.rs files.

@biplab5464
Copy link
Contributor Author

biplab5464 commented Mar 8, 2024

It may be the cause but i do coding in WSL, so i think it shouldn't be a problem

but still i will check

Copy link
Contributor

@oddgrd oddgrd left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my review @biplab5464! Sorry about the delay in responding, we've had Easter holidays here. And sorry about this PR taking so long, it's turned out to be a bit larger than we expected. But it's getting closer!

I have left some more comments you need to address. There are conflicts with main as well, so I would suggest you first fetch the latest main, then merge it into your branch. Then, address my review and test the changes.

And since this turned out to be more substantial than expected for a good first issue, do let us know if you are not able to continue, or if it has become too time-consuming for you, and we can take it over.

proto/logger.proto Outdated Show resolved Hide resolved
deployer/src/handlers/mod.rs Outdated Show resolved Hide resolved
deployer/src/handlers/mod.rs Outdated Show resolved Hide resolved
common/src/log.rs Outdated Show resolved Hide resolved
cargo-shuttle/src/client.rs Outdated Show resolved Hide resolved
@biplab5464
Copy link
Contributor Author

yeah it is bit challenging and i like it so much, i am learning a lot of thing. Please guide me as it is. It is a fun learning experience.

My laptop charger broke so i couldn't do anything for 2 weeks as it was getting dispatch. So sorry for the delay. Also i fell sick in between. Also i am have job so mostly i able to work on it on weekends mostly. I mean i able to give less time on weekday I will be consistent form now.

Copy link
Member

@jonaro00 jonaro00 left a comment

Choose a reason for hiding this comment

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

Did some final fixes, tested and works as expected. Great job @biplab5464

Copy link
Contributor

@oddgrd oddgrd left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @biplab5464!

@biplab5464
Copy link
Contributor Author

Nice changes @jonaro00, i don't know why it didn't strike my mind. Thanks for teaching me
Also thanks to @oddgrd for guiding me
I learn a lot.
Hope i will work with you again in future.

@oddgrd oddgrd merged commit b5116c7 into shuttle-hq:main Apr 22, 2024
24 checks passed
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