Merge pull request #1768 from FarmBot/master-hotfix/update-fallback

Minor hotfix
master
Rick Carlino 2020-04-23 20:07:29 -05:00 committed by GitHub
commit de607e3e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -263,7 +263,7 @@ export function FbosDetails(props: FbosDetailsProps) {
soc_temp, wifi_level, uptime, memory_usage, disk_usage, throttled,
wifi_level_percent, cpu_usage, private_ip,
} = props.botInfoSettings;
const { last_ota, last_ota_checkup } = props.deviceAccount.body;
const { last_ota, last_ota_checkup, fbos_version } = props.deviceAccount.body;
const infoFwCommit = firmware_version?.includes(".") ? firmware_commit : "---";
const firmwareCommit = firmware_version?.split("-")[1] || infoFwCommit;
@ -273,6 +273,7 @@ export function FbosDetails(props: FbosDetailsProps) {
botToMqttLastSeen={props.botToMqttLastSeen}
timeSettings={props.timeSettings}
device={props.deviceAccount} />
<p><b>{t("Version last seen")}: </b>{fbos_version}</p>
<p><b>{t("Environment")}: </b>{env}</p>
<CommitDisplay title={t("Commit")}
repo={FarmBotRepo.FarmBotOS} commit={commit} />

View File

@ -120,7 +120,7 @@ export function createShouldDisplayFn(
const fallback = globalConfig.FBOS_END_OF_LIFE_VERSION ||
FbosVersionFallback.NULL;
const target = override || current || fallback;
const table = lookupData || {};
const table = lookupData || fallbackData;
const min = table[feature] || MinVersionOverride.NEVER;
switch (semverCompare(target, min)) {
case SemverResult.LEFT_IS_GREATER:
@ -132,6 +132,13 @@ export function createShouldDisplayFn(
};
}
// Temporary hotfix fallback data. Please remove.
const fallbackData: MinOsFeatureLookup = {};
Object.values(Feature).map(feature =>
fallbackData[feature] = globalConfig.FBOS_END_OF_LIFE_VERSION);
fallbackData.criteria_groups = "9.2.2";
fallbackData.boot_sequence = MinVersionOverride.NEVER;
/**
* Compare the current FBOS version in the bot's
* state with the API's fbos_version string and return the greatest version. */

View File

@ -44,7 +44,9 @@ end
def get_base_branch(pull_data)
current_branch = BASE_BRANCHES.empty? ||
BASE_BRANCHES.include?(CURRENT_BRANCH) ? CURRENT_BRANCH : "staging"
pull_data.dig("base", "ref") || current_branch
provided_base_branch =
CURRENT_BRANCH.start_with?("master-hotfix/") ? "master" : nil;
pull_data.dig("base", "ref") || provided_base_branch || current_branch
end
# Gather relevant coverage data.