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

Hosting CLI: use http endpoint to return deploy milestones #2085

Merged
merged 5 commits into from Nov 3, 2023

Conversation

martinxu9
Copy link
Contributor

@martinxu9 martinxu9 commented Oct 30, 2023

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

After these steps, you're ready to open a pull request.

  • For users with less ideal internet conditions, it's possible the websocket streaming deploy milestones get disconnected. There was no retry mechanism. Instead, hosting service adds an equivalent endpoint to query these events once. CLI can query this endpoint peridiocally.

@martinxu9
Copy link
Contributor Author

@ElijahAhianyo could you help me try this PR for deploying an app? I think you ran into some issues https://discord.com/channels/1029853095527727165/1168071548817645599/1168090802740809778 I just switched out the websocket and replaced with http and retries. Let me know if it helps with this particular situation. There'll be a different PR for the overall slowness.

@ElijahAhianyo
Copy link
Collaborator

@ElijahAhianyo could you help me try this PR for deploying an app? I think you ran into some issues https://discord.com/channels/1029853095527727165/1168071548817645599/1168090802740809778 I just switched out the websocket and replaced with http and retries. Let me know if it helps with this particular situation. There'll be a different PR for the overall slowness.

Tried this fix out and it doesnt work for me, Will send the logs and details on discord

Returns:
The converted timestamp with timezone.
"""
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

What causes this to raise an exception? Generally shouldn't catch bare Exceptions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the conversion can raise TypeError, ValueError, let me change to the more specific exception types.

local_dt = datetime.fromisoformat(iso_timestamp).astimezone()
local_dt = convert_to_local_time_with_tz(iso_timestamp)
if local_dt is None:
return iso_timestamp
return local_dt.strftime("%Y-%m-%d %H:%M:%S.%f %Z")
except Exception as ex:
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, can we catch a more specific error / do we know why we need the catch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually we don't need to catch here, it's already caught in the call to convert.

from_iso_timestamp = maybe_timestamp + timedelta(microseconds=1e5)
else:
console.error(f"Unable to parse timestamp {row['timestamp']}")
raise ValueError
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we specify an error in the ValueError? Also, do we want to break out of the loop here or just continue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, we should continue here instead.

@martinxu9 martinxu9 force-pushed the martinxu9/cli-deploy-milestones branch from 90104f1 to 14b64cc Compare November 2, 2023 22:41
@picklelo picklelo merged commit 4c97b4c into main Nov 3, 2023
72 of 74 checks passed
@picklelo picklelo deleted the martinxu9/cli-deploy-milestones branch January 30, 2024 03:10
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.

None yet

3 participants