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

Allow builds on beta branches #55

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 37 additions & 10 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,44 @@ def __init__(self, name, dir):
{
'full_name' : 'upstream/master',
'label' : 'Latest',
'allowed_vehicles' : [copter, plane, rover, sub, tracker, blimp, heli]
'allowed_vehicles' : [copter, plane, rover, sub, tracker, blimp, heli],
'artifacts_dir' : '/latest',
},
{
'full_name' : 'upstream/Plane-4.3',
'label' : 'Plane 4.3 stable',
'allowed_vehicles' : [plane]
'allowed_vehicles' : [plane],
'artifacts_dir' : '/stable',
},
{
'full_name' : 'upstream/Copter-4.3',
'label' : 'Copter 4.3 stable',
'allowed_vehicles' : [copter, heli]
'allowed_vehicles' : [copter, heli],
'artifacts_dir' : '/stable',
},
{
'full_name' : 'upstream/Rover-4.3',
'label' : 'Rover 4.3 stable',
'allowed_vehicles' : [rover]
'allowed_vehicles' : [rover],
'artifacts_dir' : '/stable',
},
{
'full_name' : 'upstream/Copter-4.4',
'label' : 'Copter 4.4 beta',
'allowed_vehicles' : [copter, heli],
'artifacts_dir' : '/beta',
Copy link
Contributor

Choose a reason for hiding this comment

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

Ithink we should be consistent with our directory names and labels/full_name - either include 4.4 everywhere or remove it everywhere. Given we may want to run multiple betas in parallel, probably including it here makes sense.

},
{
'full_name' : 'upstream/Plane-4.4',
'label' : 'Plane 4.4 beta',
'allowed_vehicles' : [plane],
'artifacts_dir' : '/beta',
},
{
'full_name' : 'upstream/Rover-4.4',
'label' : 'Rover 4.4 beta',
'allowed_vehicles' : [rover],
'artifacts_dir' : '/beta',
},
]
default_branch = BRANCHES[0]
Expand Down Expand Up @@ -756,6 +778,12 @@ def get_firmware_version(vehicle_name, branch):
firmware_version = match.group(1)
return firmware_version

def get_artifacts_dir(branch_full_name):
for branch in BRANCHES:
if branch_full_name == branch['full_name']:
return branch['artifacts_dir']
return ""

@app.route("/get_defaults/<string:vehicle_name>/<string:remote>/<string:branch_name>/<string:board>", methods = ['GET'])
def get_deafults(vehicle_name, remote, branch_name, board):
if not remote == "upstream":
Expand All @@ -775,13 +803,12 @@ def get_deafults(vehicle_name, remote, branch_name, board):
if vehicle_name == "Heli":
vehicle_name = "Copter"

artifacts_dir = vehicle_name
if branch_name == "master":
artifacts_dir += "/latest"
else:
artifacts_dir += ("/stable-"+get_firmware_version(vehicle_name, branch))
artifacts_dir = get_artifacts_dir(branch)

if artifacts_dir == "":
return ("Could not determine artifacts directory for given combination", 400)

artifacts_dir += "/"+board
artifacts_dir = vehicle_name + artifacts_dir + "/" + board
path = "https://firmware.ardupilot.org/"+artifacts_dir+"/features.txt"
response = requests.get(path, timeout=30)

Expand Down