Skip to content

Commit 78b5d47

Browse files
authored
Merge branch 'main' into 833-add-warning-if-connected-to-aircraft-and-try-to-quit-fgcs
2 parents 3f69602 + 4ecc991 commit 78b5d47

36 files changed

Lines changed: 2297 additions & 632 deletions

CONTRIBUTING.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Contributing
2+
3+
This document outlines the full process for creating, working on, and merging tickets within the FGCS repository.
4+
All steps can be completed directly through GitHub and VS Code.
5+
6+
---
7+
8+
## Creating a Ticket
9+
10+
Navigate to the **Kanban board** on GitHub, decide which column your ticket belongs in, and click the **“Add item”** button at the bottom.
11+
12+
<p align="center">
13+
<img width="1274" height="742" alt="image" src="https://github.com/user-attachments/assets/73d45392-fa9c-4ee0-83f7-53e009584363" />
14+
</p>
15+
16+
Then click the small **“+”** on the lower left-hand side and select **“Create new issue.”**
17+
18+
<p align="center">
19+
<img width="1280" height="743" alt="image" src="https://github.com/user-attachments/assets/23bf0b32-bb68-4abc-861c-a58c2a6b8ee2" />
20+
</p>
21+
22+
Fill in all required details clearly and concisely.
23+
24+
> 💡 **Tip:** Write your ticket titles in a short, descriptive format — e.g. `Fix telemetry dashboard alignment` or `Add settings panel layout`.
25+
26+
---
27+
28+
## Starting Work on a Ticket
29+
30+
You can either:
31+
- Create a new ticket to work on, **or**
32+
- Select a **pre-existing ticket** that hasn’t yet been assigned.
33+
34+
1. Open the ticket and click **“Assign yourself”** in the top-right corner so no one else duplicates the work.
35+
36+
2. Drag your ticket into the **“In Progress”** column on the board.
37+
38+
3. Open the ticket again, locate the **Development** section on the right-hand side, and click **“Create a new branch.”**
39+
Then click **“Create Branch.”**
40+
41+
<p align="center">
42+
<img width="1274" height="742" alt="image" src="https://github.com/user-attachments/assets/f938c231-57f9-47d7-9605-71aa5776bf84" />
43+
</p>
44+
45+
4. Copy the suggested Git commands and paste them into your VS Code terminal.
46+
47+
5. Verify that you’re on the correct branch — the branch name appears in the **bottom-left corner** of VS Code.
48+
49+
<p align="center">
50+
<img width="1280" height="809" alt="image" src="https://github.com/user-attachments/assets/3e3f4ba7-ff25-412c-8db9-2c56b3bbb67e" />
51+
</p>
52+
53+
---
54+
55+
## Committing and Pushing Changes
56+
57+
You can commit changes using **VS Code (recommended)** or **Bash**.
58+
59+
### Method 1: VS Code (Recommended)
60+
61+
1. Open the **Source Control** tab on the left-hand side.
62+
2. Right-click the files you want to commit and select **“Stage Changes.”**
63+
Confirm the correct files appear under the *Staged Changes* section.
64+
3. Add a clear commit message describing your changes.
65+
4. Press **Commit**, then click the **arrows in the bottom-left corner** to *Synchronize Changes* (push your commit).
66+
67+
<p align="center">
68+
<img width="1294" height="798" alt="image" src="https://github.com/user-attachments/assets/925c060c-fd4b-4e0f-af9d-bfbcb666ccdc" />
69+
</p>
70+
71+
72+
---
73+
74+
### Method 2: Bash (Terminal)
75+
76+
If you prefer the command line, use the following:
77+
78+
```bash
79+
# Stage all changes
80+
git add .
81+
82+
# Or stage specific files
83+
git add <filename>
84+
85+
# Commit your staged changes with a descriptive message
86+
git commit -m "Description of your work"
87+
88+
# Push your changes to your branch
89+
git push origin <branch name>
90+
```
91+
92+
---
93+
94+
### Merging
95+
Navigate to the ticket again and open a pull request. Wait until the automatic tests are ran and fix any changes suggested by those.
96+
97+
Then, in the top right click reviewers then Copilot (GitHub Pro required). Copilot will then offer a code review, it is strongly suggested you make these changes.
98+
99+
Finally, request the "Avis Code team" as a reviewer, and one of the official code reviewers will look over your work. If they deem it suitable to merge, you will be cleared to merge; alternatively, changes will be suggested which you will make and then request another review.

building/macos/build.sh

100644100755
Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,44 @@
22
set -euo pipefail
33

44
# Build FGCS for macOS (arm64 by default). Run from any directory.
5-
# Usage: ./build.sh <version>
5+
# Usage: ./build.sh [version]
6+
# If no version is provided, the script will show current version and prompt for new one
67

7-
if [[ ${1:-} == "" ]]; then
8-
echo "Usage: $0 <version>"
9-
echo "Example: $0 0.2.0-alpha"
10-
exit 1
11-
fi
12-
13-
VERSION="$1"
8+
VERSION="${1:-}"
149

1510
echo "Assuming location is FGCS/building/macos"
1611
cd ../../
1712

13+
# Read and display current version from package.json
14+
echo "Reading current version from package.json..."
15+
PACKAGE_JSON_PATH="./gcs/package.json"
16+
if [[ -f "$PACKAGE_JSON_PATH" ]]; then
17+
CURRENT_VERSION=$(grep '"version"' "$PACKAGE_JSON_PATH" | sed 's/.*"version": *"\([^"]*\)".*/\1/')
18+
echo "Current version: $CURRENT_VERSION"
19+
20+
# Prompt for version if not provided
21+
if [[ -z "$VERSION" ]]; then
22+
read -p "Enter new version number: " VERSION
23+
if [[ -z "$VERSION" ]]; then
24+
echo "Error: Version is required to continue"
25+
exit 1
26+
fi
27+
fi
28+
29+
echo "New version will be: $VERSION"
30+
else
31+
echo "Warning: Could not find package.json at $PACKAGE_JSON_PATH"
32+
33+
# Still prompt for version if package.json not found
34+
if [[ -z "$VERSION" ]]; then
35+
read -p "Enter version number: " VERSION
36+
if [[ -z "$VERSION" ]]; then
37+
echo "Error: Version is required to continue"
38+
exit 1
39+
fi
40+
fi
41+
fi
42+
1843
echo "Building backend"
1944
cd radio
2045
source ./venv/bin/activate

building/windows/build.ps1

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,48 @@
44
55
.EXAMPLE
66
.\build.ps1 -Version "0.1.8-alpha"
7+
.\build.ps1
78
#>
89

910
Param (
10-
[Parameter(Mandatory = $true)]
11+
[Parameter(Mandatory = $false)]
1112
[string]$Version
1213
)
1314

14-
Write-Output "Building backend"
1515
Write-Output "Assuming location is FGCS\building\windows"
1616
Set-Location ../../
1717

18+
# Read and display current version from package.json
19+
Write-Output "Reading current version from package.json..."
20+
$packageJsonPath = ".\gcs\package.json"
21+
if (Test-Path $packageJsonPath) {
22+
$packageJson = Get-Content $packageJsonPath | ConvertFrom-Json
23+
$currentVersion = $packageJson.version
24+
Write-Output "Current version: $currentVersion"
25+
26+
# Prompt for version if not provided
27+
if (-not $Version) {
28+
$Version = Read-Host "Enter new version number"
29+
if (-not $Version) {
30+
Write-Error "Version is required to continue"
31+
exit 1
32+
}
33+
}
34+
35+
Write-Output "New version will be: $Version"
36+
} else {
37+
Write-Warning "Could not find package.json at $packageJsonPath"
38+
39+
# Still prompt for version if package.json not found
40+
if (-not $Version) {
41+
$Version = Read-Host "Enter version number"
42+
if (-not $Version) {
43+
Write-Error "Version is required to continue"
44+
exit 1
45+
}
46+
}
47+
}
48+
1849
Write-Output "Building backend"
1950
Set-Location radio
2051
pip install pyinstaller

0 commit comments

Comments
 (0)