mirror of
https://github.com/Pythagora-io/gpt-pilot.git
synced 2026-01-09 21:27:53 -05:00
Merge pull request #892 from Pythagora-io/pr-feedback
removing unused code and reverting tests to python 3.9
This commit is contained in:
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@@ -30,17 +30,12 @@ jobs:
|
||||
matrix:
|
||||
# Test latest and oldest supported Python releases
|
||||
# See https://devguide.python.org/versions/
|
||||
python-version: ['3.11', '3.12']
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: ['3.9', '3.12']
|
||||
os: [ubuntu-latest, macos-12, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js 20
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
|
||||
@@ -48,41 +48,6 @@ def trace_code_event(name: str, data: dict):
|
||||
def get_path_id():
|
||||
return telemetry.telemetry_id
|
||||
|
||||
def ask_to_store_prompt(project, path_id):
|
||||
init_prompt = project.main_prompt if project is not None and project.main_prompt else None
|
||||
if init_prompt is None:
|
||||
return
|
||||
|
||||
# Prepare the prompt data
|
||||
telemetry_data = {
|
||||
"pathId": path_id,
|
||||
"event": "pilot-prompt",
|
||||
"data": init_prompt
|
||||
}
|
||||
question = ('We would appreciate if you let us store your initial app prompt. If you are OK with that, please just '
|
||||
'press ENTER')
|
||||
|
||||
try:
|
||||
answer = ask_user(project, question, ignore_user_input_count=True, require_some_input=False)
|
||||
if answer == '':
|
||||
telemetry.set("initial_prompt", init_prompt)
|
||||
response = requests.post("https://api.pythagora.io/telemetry", json=telemetry_data)
|
||||
response.raise_for_status()
|
||||
except requests.RequestException as err:
|
||||
print(f"Failed to store prompt: {err}")
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
|
||||
def ask_user_feedback(project, path_id, ask_feedback):
|
||||
question = ('Were you able to create any app that works? Please write any feedback you have or just press ENTER to exit:')
|
||||
feedback = None
|
||||
if ask_feedback:
|
||||
feedback = ask_user(project, question, ignore_user_input_count=True, require_some_input=False)
|
||||
if feedback: # only send if user provided feedback
|
||||
telemetry.set("user_feedback", feedback)
|
||||
send_feedback(feedback, path_id)
|
||||
|
||||
|
||||
def ask_user_email(project):
|
||||
question = (
|
||||
@@ -98,18 +63,13 @@ def ask_user_email(project):
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
def exit_gpt_pilot(project, ask_feedback=True):
|
||||
terminate_running_processes()
|
||||
# path_id = get_path_id()
|
||||
|
||||
if ask_feedback:
|
||||
# ask_to_store_prompt(project, path_id)
|
||||
ask_user_email(project)
|
||||
|
||||
# TODO: Turned off for now because we're asking for email, and we don't want to
|
||||
# annoy people.
|
||||
# ask_user_feedback(project, path_id, ask_feedback)
|
||||
|
||||
telemetry.set("num_commands", project.command_runs_count if project is not None else 0)
|
||||
telemetry.set("num_inputs", project.user_inputs_count if project is not None else 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user