oracle / oracle/oci-python-sdk

Example uses non-existent API

Open
#878 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
474
Forks
321
Avg merge
23m
Merged PRs (30d)
4

Description

The terminate_instance example

https://github.com/oracle/oci-python-sdk/blob/084eedc79c591eefd8ff4647eb50dbc09684707b/examples/launch_instance_example.py#L417-L425

shows use of an API called terminate_instance_and_wait_for_state which was evidently removed in 2.178.0 (40a0ec43ccb3f8cd92490a69b5f55829cf369acf) in favor of terminate_instance_and_wait_for_work_request (with a different API surface).

There don't seem to be tests in this repo that would cover either terminate_instance_and_wait_for_state or terminate_instance_and_wait_for_work_request.

I do want to note that simply deleting a function that has existed since version 1.3.19 (from 2018) is developer-hostile in my books (and caused a minor production issue for us, but that is honestly on me for not having had suitable tests on our end).

Looking at the source, both terminate_instance_and_wait_for_state and terminate_instance_and_wait_for_work_request call client.terminate_instance(); there is no reason I can see that terminate_instance_and_wait_for_state couldn't coexist (with, if you'd like, a DeprecationWarning).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/launch_instance_example.py at lines 417-425 and compare the referenced terminate_instance_and_wait_for_state call with terminate_instance_and_wait_for_work_request and their underlying client. Check the existing source and test layout, since the issue reports no coverage for either API. Done means the example uses a valid API and the relevant termination behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.