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

[FEATURE] Add a feature to update Drifty #217

Open
SaptarshiSarkar12 opened this issue Jun 24, 2023 · 45 comments · May be fixed by #562
Open

[FEATURE] Add a feature to update Drifty #217

SaptarshiSarkar12 opened this issue Jun 24, 2023 · 45 comments · May be fixed by #562
Assignees
Labels
App 💻 Issues/Pull Requests which update Drifty Application Code EddieHub:good-first-issue Label for good-first-issue finder made by EddieHub Community feature ✨ New feature request or addition good first issue Good for newcomers
Milestone

Comments

@SaptarshiSarkar12
Copy link
Owner

Is your feature request related to a problem? Please describe.

Currently, Drifty can not detect if the user is running an older version or not. As a result of which, the already fixed errors and new features do not appear in the end user's application.

Describe the solution you'd like.

A feature needs to be introduced such that Drifty can check whether the user is running the latest version of Drifty or not. If the user is running an outdated version, then Drifty should update itself after taking the user's confirmation.

@SaptarshiSarkar12 SaptarshiSarkar12 added feature ✨ New feature request or addition help wanted Extra attention and support, and contributors are needed good first issue Good for newcomers EddieHub:good-first-issue Label for good-first-issue finder made by EddieHub Community App 💻 Issues/Pull Requests which update Drifty Application Code labels Jun 24, 2023
@SaptarshiSarkar12
Copy link
Owner Author

If anyone wants to work on this issue, please comment your name here and I shall assign you.

@Sakshikumari28
Copy link

i want to work in this issue

@SaptarshiSarkar12
Copy link
Owner Author

i want to work in this issue

Sure @Sakshikumari28 , you can work on this issue. I am assigning you with the task.

@SaptarshiSarkar12
Copy link
Owner Author

@Sakshikumari28 Have you started working on this issue? Are you facing any problems? Let me know.

@Sakshikumari28
Copy link

Sakshikumari28 commented Jul 5, 2023 via email

@SaptarshiSarkar12
Copy link
Owner Author

I'm setting of the project in my local environment

On Wed, 5 Jul, 2023, 1:51 pm Saptarshi Sarkar, @.> wrote: @Sakshikumari28 https://github.com/Sakshikumari28 Have you started working on this issue? Are you facing any problems? Let me know. — Reply to this email directly, view it on GitHub <#217 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZWYO2XFHEWICP6BPH4PVG3XOUP2DANCNFSM6AAAAAAZSRSZUA . You are receiving this because you were mentioned.Message ID: @.>

Great 👍 @Sakshikumari28

@SaptarshiSarkar12 SaptarshiSarkar12 removed the help wanted Extra attention and support, and contributors are needed label Jul 6, 2023
@SaptarshiSarkar12
Copy link
Owner Author

I'm setting of the project in my local environment

On Wed, 5 Jul, 2023, 1:51 pm Saptarshi Sarkar, @.> wrote: @Sakshikumari28 https://github.com/Sakshikumari28 Have you started working on this issue? Are you facing any problems? Let me know. — Reply to this email directly, view it on GitHub <#217 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZWYO2XFHEWICP6BPH4PVG3XOUP2DANCNFSM6AAAAAAZSRSZUA . You are receiving this because you were mentioned.Message ID: @.>

@Sakshikumari28 What is your progress on this issue?

@SaptarshiSarkar12
Copy link
Owner Author

I'm setting of the project in my local environment

On Wed, 5 Jul, 2023, 1:51 pm Saptarshi Sarkar, @.> wrote: @Sakshikumari28 https://github.com/Sakshikumari28 Have you started working on this issue? Are you facing any problems? Let me know. — Reply to this email directly, view it on GitHub <#217 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZWYO2XFHEWICP6BPH4PVG3XOUP2DANCNFSM6AAAAAAZSRSZUA . You are receiving this because you were mentioned.Message ID: _@**.**_>

@Sakshikumari28 What is your progress on this issue?

@Sakshikumari28 Please respond.

@sayande717
Copy link

Here's what I want to do:

  • Create a new flag, -u/-update.
  • When this flag is called, we first fetch the latest version tag from the Github API. We compare it with the local tag, and update if needed.
API: https://api.github.com/repos/SaptarshiSarkar12/Drifty/releases/latest
Key-value pair: "tag_name":"v0.0.0"
  • After we implement this, we can auto-run this particular code whenever Drifty is started up.

But I can't understand how I'm gonna call the API from Java. I've never worked with API's using Java as a back-end before, so can anyone help me / link me to a resource where I can get the instructions or how to call the API properly for this use case?

@SaptarshiSarkar12
Copy link
Owner Author

@sayande717 The update flag should be

- -u/-update
+ -u/--update

and how are you going to implement the new code, that is, how is the new version going to replace the old one?

@SaptarshiSarkar12
Copy link
Owner Author

@sayande717 After we get the tag_name from the api, we can check if that matches or is greater or smaller with respect to the user's Drifty version. There is a VERSION constant in DriftyConstants.java file, which will provide the version the user is using.
The API call can be made using the HttpsUrlConnection class of Java. After we receive the API response, we can parse that by a JSON parser for java and get the latest version in string format.
References for API calling -

@Sakshikumari28
Copy link

Sakshikumari28 commented Jul 19, 2023 via email

@SaptarshiSarkar12
Copy link
Owner Author

SaptarshiSarkar12 commented Jul 19, 2023

Sorry for the late reply sir I tried but I wasn't able to do this task assigned to me I apologize for that .you can assign to some other

It's okay, no problem @Sakshikumari28

@SaptarshiSarkar12 SaptarshiSarkar12 added the help wanted Extra attention and support, and contributors are needed label Jul 19, 2023
@SaptarshiSarkar12
Copy link
Owner Author

@sayande717 What is the progress on this issue?

@sayande717
Copy link

sayande717 commented Jul 19, 2023

@SaptarshiSarkar12
Actually I'm a bit busy this week because of family issues. I'll try setting the API and stuff, because I need to learn that before...I'll notify you whenever I can get back on it, hopefully I'll be free next week.

@SaptarshiSarkar12
Copy link
Owner Author

@SaptarshiSarkar12 Actually I'm a bit busy this week because of family issues. I'll try setting the API and stuff, because I need to learn that before...I'll notify you whenever I can get back on it, hopefully I'll be free next week.

Ok, no problem @sayande717

@shivanjaywagh
Copy link

If this issue is still open I would like to help. @SaptarshiSarkar12

@SaptarshiSarkar12
Copy link
Owner Author

If this issue is still open I would like to help. @SaptarshiSarkar12

Yes, it is still open. If @sayande717 no longer wants to work, then you (@shivanjaywagh) can be assigned. You (@shivanjaywagh) can also collaborate with @sayande717.

@sayande717
Copy link

sayande717 commented Aug 2, 2023

If this issue is still open I would like to help. @SaptarshiSarkar12

Yes, it is still open. If @sayande717 no longer wants to work, then you (@shivanjaywagh) can be assigned. You (@shivanjaywagh) can also collaborate with @sayande717.

I don't think I'll be able to actively work on this right now, I have some important college projects coming up so I need to focus on that. So, @SaptarshiSarkar12 , you can assign it to @shivanjaywagh .

@SaptarshiSarkar12
Copy link
Owner Author

If this issue is still open I would like to help. @SaptarshiSarkar12

Yes, it is still open. If @sayande717 no longer wants to work, then you (@shivanjaywagh) can be assigned. You (@shivanjaywagh) can also collaborate with @sayande717.

I don't think I'll be able to actively work on this right now, I have some important college projects coming up so I need to focus on that. So, @SaptarshiSarkar12 , you can assign it to @shivanjaywagh .

@sayande717 Ok, no problem.

@shivanjaywagh You can work on this issue. But, there is some important note :
The code for the Drifty GUI is going to have a massive change (via #233 closing the issue #231) with some effect on the CLI code also. So, you can check the code from the pull request author's PR branch. Let me know if this is okay for you.

@keshav08
Copy link

@SaptarshiSarkar12 I will join the discord for the further discussion.

@kmr-rohit
Copy link

Hi @SaptarshiSarkar12 ,

I'd like to contribute to this feature as well. I think @keshav08 and I can work together to explore ways to implement it.

@SaptarshiSarkar12
Copy link
Owner Author

@SaptarshiSarkar12 Yes, I would like to explore more and will contribute this feature. When will be the #233 merged? Till then I will look into the repo

@keshav08 It depends on the speed of development of the feature by the pull request author. I think it should not take more than 2 weeks.

@SaptarshiSarkar12
Copy link
Owner Author

@SaptarshiSarkar12 I will join the discord for the further discussion.

Sure 👍! @keshav08 That's a good idea as you will get to know when #233 is going to get merged via discord.

@SaptarshiSarkar12
Copy link
Owner Author

Hi @SaptarshiSarkar12 ,

I'd like to contribute to this feature as well. I think @keshav08 and I can work together to explore ways to implement it.

Yes, you both (@keshav08 and @kmr-rohit) can discuss and contribute together on this issue. I am assigning to both of you.

@keshav08
Copy link

@SaptarshiSarkar12 So, should I go through the repo for now? And do I have to wait to start coding until the merge?

@SaptarshiSarkar12
Copy link
Owner Author

SaptarshiSarkar12 commented Aug 13, 2023

@SaptarshiSarkar12 So, should I go through the repo for now? And do I have to wait to start coding until the merge?

Yes, you can go through it. Only the GUI package is going to change, which has no effect on this issue.
Remember, the executable filenames will get changed as below.

Linux Windows macOS
Drifty CLI Drifty CLI.exe / msi
[To be decided later on]
Drifty CLI.pkg / dmg
[To be decided later on]
Drifty GUI Drifty GUI.exe / msi
[To be decided later on]
Drifty GUI.pkg / dmg
[To be decided later on]

@keshav08 @kmr-rohit I have an idea/suggestion on the way this issue can be solved the most reliably.
You need to create a JavaFX app named Drifty Updater which will be under the Updater directory. It will be built as a separate executable.

Drifty will check if any update is available by getting the tag_name json field from the JSON response provided by the GitHub API call (https://api.github.com/repos/SaptarshiSarkar12/Drifty/releases/latest?tag_name). The tag_name contains the major, minor and patch version number. Drifty contains a version variable inside the Drifty backend. It will match the fetched version with its current version and if it is outdated, then, it will download and run the updater JavaFX app to which Drifty's current location and type of application (CLI or GUI) will be passed as command line arguments.
The updater will download the latest version and keep it in the temp directory. It will then replace the outdated one with the new one. Finally, it is going to run the new Drifty CLI or GUI.

Hence, Drifty gets updated 🎉!

If you have any suggestions on this idea, please let me know.

@SaptarshiSarkar12
Copy link
Owner Author

@SaptarshiSarkar12 So, should I go through the repo for now? And do I have to wait to start coding until the merge?

You both can start working, no issue!

@kmr-rohit
Copy link

@SaptarshiSarkar12 Thank you for your suggestion , me along with @keshav08 will explore the codebase , and try to work in your suggested direction. Will catch you up whenever required.

@SaptarshiSarkar12
Copy link
Owner Author

@SaptarshiSarkar12 Thank you for your suggestion , me along with @keshav08 will explore the codebase , and try to work in your suggested direction. Will catch you up whenever required.

Sure 👍!

@SaptarshiSarkar12 SaptarshiSarkar12 removed the help wanted Extra attention and support, and contributors are needed label Aug 23, 2023
@SaptarshiSarkar12 SaptarshiSarkar12 added the hacktoberfest Issues/Pull Requests for Hacktoberfest label Sep 26, 2023
@SaptarshiSarkar12 SaptarshiSarkar12 removed the hacktoberfest Issues/Pull Requests for Hacktoberfest label Nov 1, 2023
@SaptarshiSarkar12 SaptarshiSarkar12 added the help wanted Extra attention and support, and contributors are needed label Jan 1, 2024
@SaptarshiSarkar12
Copy link
Owner Author

@keshav08 @kmr-rohit Is anyone of you interested in working on this issue? If not, I'm going to unassign you.

@SaptarshiSarkar12
Copy link
Owner Author

As anyone of you (@keshav08 and @kmr-rohit) are no longer interested in working on this issue, so, I'll work on it.
Thank you for your support!

@SaptarshiSarkar12 SaptarshiSarkar12 removed the help wanted Extra attention and support, and contributors are needed label Jan 13, 2024
@SaptarshiSarkar12 SaptarshiSarkar12 linked a pull request Jan 17, 2024 that will close this issue
12 tasks
@SaptarshiSarkar12 SaptarshiSarkar12 linked a pull request Jul 6, 2024 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App 💻 Issues/Pull Requests which update Drifty Application Code EddieHub:good-first-issue Label for good-first-issue finder made by EddieHub Community feature ✨ New feature request or addition good first issue Good for newcomers
Projects
Status: In Progress
7 participants