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

1 add size to status table #15

Merged
merged 14 commits into from
Oct 5, 2023
Merged

1 add size to status table #15

merged 14 commits into from
Oct 5, 2023

Conversation

bohendo
Copy link
Collaborator

@bohendo bohendo commented Oct 4, 2023

resolves #1

Also add cost info & elapsed time to the status table and adds additional droplet info to the status file.

Summary by CodeRabbit

  • New Feature: Enhanced ConfirmDeleteDroplets function to accept different droplet names, increasing its flexibility and reusability.
  • New Feature: Updated Launch function to include additional droplet information in the status file.
  • New Feature: Added cost and elapsed time details to the status table for better tracking and management.
  • Refactor: Streamlined code by replacing table printing with a call to the PrintStatus function.
  • New Feature: Enriched PrintStatus function to display additional information including cost and elapsed time.
  • Bug Fix: Ensured that the COMPLETED flag is set to true regardless of the exit code value.
  • New Feature: Introduced a new Size struct to represent droplet size, including CPU, disk, memory, and hourly cost.
  • New Feature: Added GetDropletById function to retrieve a droplet by its ID.
  • Refactor: Updated GetJobIdsByInstance function to use Droplet.ID instead of InstanceID.
  • Bug Fix: Added error check for uninitialized Droplet.ID values.

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

Image description CodeRabbit

Walkthrough

This update enhances the cloudexec command-line tool by improving its flexibility, reusability, and information richness. Changes include modifications to droplet handling functions, addition of cost and elapsed time data to status reports, and updates to the JobInfo struct to include more detailed droplet information. The code has been refactored for better consistency and maintainability.

Changes

File(s) Summary
cmd/cloudexec/clean.go, cmd/cloudexec/launch.go, cmd/cloudexec/main.go, cmd/cloudexec/status.go, cmd/cloudexec/user_data.sh.tmpl Enhanced the ConfirmDeleteDroplets and Launch functions for better flexibility and reusability. Added cost and elapsed time information to the status table. Improved variable naming consistency. Refactored status table printing with a call to the PrintStatus function. Updated job completion flag setting logic.
pkg/digitalocean/digitalocean.go, pkg/state/state.go Introduced a new Size struct to represent droplet size details. Updated CreateDroplet and GetDropletsByName functions to populate the Size field. Added a new function GetDropletById. Modified the JobInfo struct to include a Droplet field and updated the GetJobIdsByInstance function accordingly.

🐇💻

Code refined, features combined,

With every line, our tool's designed.

Now it sings, now it springs,

Celebrate the joy it brings! 🎉🥳


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 49d7ed8 and ae6f312 commits.
Files selected (7)
  • cmd/cloudexec/clean.go (1)
  • cmd/cloudexec/launch.go (1)
  • cmd/cloudexec/main.go (5)
  • cmd/cloudexec/status.go (1)
  • cmd/cloudexec/user_data.sh.tmpl (1)
  • pkg/digitalocean/digitalocean.go (4)
  • pkg/state/state.go (3)
Files not reviewed due to errors (2)
  • cmd/cloudexec/status.go (no response)
  • cmd/cloudexec/launch.go (no response)
Review comments generated (14)
  • Review: 8
  • LGTM: 6

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

pkg/digitalocean/digitalocean.go Outdated Show resolved Hide resolved
cmd/cloudexec/clean.go Show resolved Hide resolved
cmd/cloudexec/main.go Show resolved Hide resolved
cmd/cloudexec/main.go Show resolved Hide resolved
pkg/state/state.go Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between ae6f312 and 66eef37 commits.
Files selected (3)
  • cmd/cloudexec/user_data.sh.tmpl (2)
  • pkg/digitalocean/digitalocean.go (4)
  • pkg/state/state.go (3)
Review comments generated (9)
  • Review: 5
  • LGTM: 4

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

pkg/state/state.go Show resolved Hide resolved
pkg/state/state.go Outdated Show resolved Hide resolved
cmd/cloudexec/user_data.sh.tmpl Show resolved Hide resolved
cmd/cloudexec/user_data.sh.tmpl Show resolved Hide resolved
pkg/digitalocean/digitalocean.go Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 66eef37 and ff62912 commits.
Files selected (1)
  • pkg/state/state.go (3)
Review comments generated (3)
  • Review: 2
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

pkg/state/state.go Show resolved Hide resolved
pkg/state/state.go Show resolved Hide resolved
@bohendo bohendo merged commit 6353b73 into main Oct 5, 2023
@bohendo bohendo deleted the 1-add-size-to-status-table branch October 5, 2023 20:01
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.

Add droplet size to status table
1 participant