diff --git a/docs/design/versioning.md b/docs/design/versioning.md index 595ddb33..398241b2 100644 --- a/docs/design/versioning.md +++ b/docs/design/versioning.md @@ -19,7 +19,7 @@ Do not set `Version`, `FileVersion` or `InformationalVersion` in `Bravo.csproj`: | Value | Shape | Authoritative for | | --- | --- | --- | -| `AssemblyFileVersion` | `X.Y.Z.{height}` | ordering two builds; MSI `ProductVersion` | +| `AssemblyFileVersion` | `X.Y.Z.{height}` | ordering two builds; MSI `ProductVersion`; the update feed `version` | | `AssemblyInformationalVersion` | `X.Y.Z.{height}[-tag]+{commit}` | diagnostics | | `AssemblyVersion` | `X.Y.0.0` | assembly identity (`assemblyVersion.precision: minor`) | | `NBGV_SemVer2` | `X.Y.Z[-tag]` | artifact names, git tag, `AppVersion.SemanticVersion`, WiX `-dVersion` | @@ -29,9 +29,15 @@ every build uniquely identifiable and orders builds that share the same `X.Y.Z`. ## Rules +- **The update feed `version` is the four-field `AssemblyFileVersion` of the release.** Installed clients compare it +with their own file version through `Version.Parse`. A three-field value compares lower than every build of the same +`X.Y.Z`, so a preview user is never told about the release that follows it; a non-numeric value makes the check fail +in every installed client ([ADR 0001](../adr/0001-releases-without-update-channels.md)). + - **The prerelease tag never reaches a numeric field.** `AssemblyFileVersion` stays numeric in every state, so Windows Installer and `System.Version` keep working unchanged. WiX `-dVersion` carries the tag but feeds the -installer telemetry only: the MSI `ProductVersion` is bound to the file version of `Bravo.exe`. +installer telemetry only: the MSI `ProductVersion` is bound to the file version of `Bravo.exe`. Local builds made with +`publish.cmd` pass `0.0.0`, so their installer telemetry is not mistaken for a release. - **`SemVer2` is the version that the application, the installer and the artifacts report.** The application reads it as `ThisAssembly.NuGetPackageVersion`, which equals `SemVer2` only while diff --git a/publish.cmd b/publish.cmd index 20b8b5b5..bb3677d5 100644 --- a/publish.cmd +++ b/publish.cmd @@ -17,7 +17,7 @@ IF %ERRORLEVEL% NEQ 0 ( SET arch=x64 SET selfcontained=true SET configuration=Release -SET version="0.0.0.999-DEV"& :: Do not change, see also on Bravo.csproj +SET version="0.0.0"& :: 0.0.0 keeps local builds apart from releases SET verbosity="Minimal"& :: Minimal,Normal,Diagnostic,Detailed SET wixheat="%WIX%bin\heat.exe" SET wixlight="%WIX%bin\light.exe" diff --git a/src/Controllers/ApplicationController.cs b/src/Controllers/ApplicationController.cs index 94fc9d3b..372ba975 100644 --- a/src/Controllers/ApplicationController.cs +++ b/src/Controllers/ApplicationController.cs @@ -212,7 +212,7 @@ public IActionResult GetDiagnostics(long after = 0, int max = DiagnosticLogStore } /// - /// Gets the current application version for the specified + /// Gets the latest released version of the application /// /// Status200OK - Success [HttpGet] @@ -221,9 +221,9 @@ public IActionResult GetDiagnostics(long after = 0, int max = DiagnosticLogStore [Produces(MediaTypeNames.Application.Json)] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(BravoUpdate))] [ProducesDefaultResponseType] - public async Task GetCurrentVersion(UpdateChannelType updateChannel, CancellationToken cancellationToken) + public async Task GetCurrentVersion(CancellationToken cancellationToken) { - var bravoUpdate = await CommonHelper.CheckForUpdateAsync(updateChannel, _logger, cancellationToken); + var bravoUpdate = await CommonHelper.CheckForUpdateAsync(_logger, cancellationToken); if (bravoUpdate.IsNewerVersion) System.Media.SystemSounds.Beep.Play(); diff --git a/src/Infrastructure/Configuration/Settings/UserSettings.cs b/src/Infrastructure/Configuration/Settings/UserSettings.cs index e13f3ea2..4888cf21 100644 --- a/src/Infrastructure/Configuration/Settings/UserSettings.cs +++ b/src/Infrastructure/Configuration/Settings/UserSettings.cs @@ -9,8 +9,6 @@ public interface IUserSettings DiagnosticLevelType DiagnosticLevel { get; set; } - UpdateChannelType UpdateChannel { get; set; } - bool UpdateCheckEnabled { get; set; } ThemeType Theme { get; set; } @@ -28,7 +26,6 @@ public class UserSettings : IUserSettings { public const bool DefaultTelemetryEnabled = true; public const DiagnosticLevelType DefaultDiagnosticLevel = DiagnosticLevelType.None; - public const UpdateChannelType DefaultUpdateChannel = UpdateChannelType.Stable; public const bool DefaultUpdateCheckEnabled = true; public const ThemeType DefaultTheme = ThemeType.Auto; public const bool DefaultUseSystemBrowserForAuthentication = false; @@ -40,9 +37,6 @@ public class UserSettings : IUserSettings [JsonPropertyName("diagnosticLevel")] public DiagnosticLevelType DiagnosticLevel { get; set; } = DefaultDiagnosticLevel; - [JsonPropertyName("updateChannel")] - public UpdateChannelType UpdateChannel { get; set; } = DefaultUpdateChannel; - [JsonPropertyName("updateCheckEnabled")] public bool UpdateCheckEnabled { get; set; } = DefaultUpdateCheckEnabled; @@ -69,29 +63,6 @@ public enum ThemeType Dark = 2 } -public enum UpdateChannelType -{ - /// - /// (Default) Stable builds are the best ones to use, they are a result of the code being built in Canary, tested in Dev and bug fixed in Beta - /// - Stable = 0, - - ///// - ///// Beta channel is the best build to get if you’re interested in being the first one to know about upcoming features - ///// - //Beta = 1, - - /// - /// Dev build will carry the improvements made to the application and tested by the developers, it’s still not recommended to use it because it can have bugs - /// - Dev = 2, - - ///// - ///// Canary build carries features that are released as soon as they’re built and are not tested or used - ///// - //Canary = 3, -} - public enum DiagnosticLevelType { None = 0, diff --git a/src/Infrastructure/Helpers/CommonHelper.cs b/src/Infrastructure/Helpers/CommonHelper.cs index 00391b4c..8fa89d3a 100644 --- a/src/Infrastructure/Helpers/CommonHelper.cs +++ b/src/Infrastructure/Helpers/CommonHelper.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using System.Windows.Forms; using Microsoft.Extensions.Logging; -using Sqlbi.Bravo.Infrastructure.Configuration.Settings; using Sqlbi.Bravo.Infrastructure.Extensions; using Sqlbi.Bravo.Infrastructure.Windows.Interop; using Sqlbi.Bravo.Models; @@ -91,17 +90,10 @@ public static string NormalizeUriString(string uriString) return directoryName; } - public static async Task CheckForUpdateAsync(UpdateChannelType updateChannel, ILogger logger, CancellationToken cancellationToken) + public static async Task CheckForUpdateAsync(ILogger logger, CancellationToken cancellationToken) { - var channelPath = updateChannel switch - { - UpdateChannelType.Stable => "bravo-public", - UpdateChannelType.Dev => "bravo-internal", - _ => throw new BravoUnexpectedInvalidOperationException($"Unhandled {nameof(UpdateChannelType)} value ({updateChannel})") - }; - using var httpClient = new HttpClient(); - var requestUri = $"https://bravorelease.blob.core.windows.net/{channelPath}/currentversion.json?nocache={DateTimeOffset.Now.ToUnixTimeSeconds()}"; + var requestUri = $"https://bravorelease.blob.core.windows.net/bravo-public/currentversion.json?nocache={DateTimeOffset.Now.ToUnixTimeSeconds()}"; var json = await httpClient.GetStringAsync(requestUri, cancellationToken).ConfigureAwait(false); LogUpdateFeedReceived(logger, json); @@ -113,7 +105,6 @@ public static async Task CheckForUpdateAsync(UpdateChannelType upda return new BravoUpdate { - UpdateChannel = updateChannel, IsNewerVersion = availableVersion > installedVersion, Version = availableVersion.ToString(3), DownloadUrl = GetDownloadUrl(rootElement.GetProperty("download").GetString()!), diff --git a/src/Infrastructure/Policies/IPolicySource.cs b/src/Infrastructure/Policies/IPolicySource.cs index 3418c5b8..da9aa4fd 100644 --- a/src/Infrastructure/Policies/IPolicySource.cs +++ b/src/Infrastructure/Policies/IPolicySource.cs @@ -25,16 +25,5 @@ internal static class PolicySourceExtensions _ => null, // Invalid policy value }; } - - /// - /// TEnum must have int as its underlying type. - /// - public TEnum? GetEnum(string name) where TEnum : struct, Enum - { - if (source.GetInt(name) is { } value && Enum.IsDefined(typeof(TEnum), value)) - return (TEnum)(object)value; - - return null; // Policy not set or invalid - } } } diff --git a/src/Infrastructure/Policies/PolicySnapshot.cs b/src/Infrastructure/Policies/PolicySnapshot.cs index 923d8f7c..aa0aca2d 100644 --- a/src/Infrastructure/Policies/PolicySnapshot.cs +++ b/src/Infrastructure/Policies/PolicySnapshot.cs @@ -1,6 +1,4 @@ -using Sqlbi.Bravo.Infrastructure.Configuration.Settings; - -namespace Sqlbi.Bravo.Infrastructure.Policies; +namespace Sqlbi.Bravo.Infrastructure.Policies; /// /// Contains the effective policy values from one read of the configured sources. @@ -10,12 +8,11 @@ namespace Sqlbi.Bravo.Infrastructure.Policies; /// public sealed record PolicySnapshot( bool? TelemetryEnabled, - UpdateChannelType? UpdateChannel, bool? UpdateCheckEnabled, bool? UseSystemBrowserForAuthentication, bool? BuiltInTemplatesEnabled, bool? CustomTemplatesEnabled, string? CustomTemplatesOrganizationRepositoryPath) { - public static PolicySnapshot NotConfigured { get; } = new(null, null, null, null, null, null, null); + public static PolicySnapshot NotConfigured { get; } = new(null, null, null, null, null, null); } diff --git a/src/Infrastructure/Policies/RegistryPolicyReader.cs b/src/Infrastructure/Policies/RegistryPolicyReader.cs index 5a97375a..71cdcf26 100644 --- a/src/Infrastructure/Policies/RegistryPolicyReader.cs +++ b/src/Infrastructure/Policies/RegistryPolicyReader.cs @@ -1,6 +1,4 @@ -using Sqlbi.Bravo.Infrastructure.Configuration.Settings; - -namespace Sqlbi.Bravo.Infrastructure.Policies; +namespace Sqlbi.Bravo.Infrastructure.Policies; internal sealed class RegistryPolicyReader(IPolicySourceFactory sourceFactory) : IPolicyReader { @@ -19,7 +17,6 @@ public PolicySnapshot Read() internal static PolicySnapshot FromSource(IPolicySource source) => new( TelemetryEnabled: source.GetBool("TelemetryEnabled"), - UpdateChannel: source.GetEnum("UpdateChannel"), UpdateCheckEnabled: source.GetBool("UpdateCheckEnabled"), UseSystemBrowserForAuthentication: source.GetBool("UseSystemBrowserForAuthentication"), BuiltInTemplatesEnabled: source.GetBool("BuiltInTemplatesEnabled"), @@ -31,7 +28,6 @@ internal static PolicySnapshot Merge(PolicySnapshot machinePolicies, PolicySnaps // LocalMachine takes precedence over CurrentUser when both are configured return new PolicySnapshot( TelemetryEnabled: machinePolicies.TelemetryEnabled ?? userPolicies.TelemetryEnabled, - UpdateChannel: machinePolicies.UpdateChannel ?? userPolicies.UpdateChannel, UpdateCheckEnabled: machinePolicies.UpdateCheckEnabled ?? userPolicies.UpdateCheckEnabled, UseSystemBrowserForAuthentication: machinePolicies.UseSystemBrowserForAuthentication ?? userPolicies.UseSystemBrowserForAuthentication, BuiltInTemplatesEnabled: machinePolicies.BuiltInTemplatesEnabled ?? userPolicies.BuiltInTemplatesEnabled, diff --git a/src/Infrastructure/Policies/Templates/bravo.admx b/src/Infrastructure/Policies/Templates/bravo.admx index c817d5dc..acc90994 100644 --- a/src/Infrastructure/Policies/Templates/bravo.admx +++ b/src/Infrastructure/Policies/Templates/bravo.admx @@ -1,6 +1,6 @@ - + @@ -45,25 +45,6 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/Infrastructure/Policies/Templates/en-US/bravo.adml b/src/Infrastructure/Policies/Templates/en-US/bravo.adml index bb92c214..bd59023d 100644 --- a/src/Infrastructure/Policies/Templates/en-US/bravo.adml +++ b/src/Infrastructure/Policies/Templates/en-US/bravo.adml @@ -1,6 +1,6 @@ - + @@ -29,15 +29,6 @@ If the status is set to Disabled, the application uses an embedded web browser for for interactive authentication. - Configure the release channel to be used when checking for updates - STABLE - stable build release channel - DEV - internal development build release channel - - If the status is set to Not Configured or Disabled, the stable channel are used by default and this setting is configured according to user preferences. - - If the status is set to Enabled, the selected update channel is forcibly used. - - Configure update checking and update notifications If the status is set to Not Configured, this setting is configured according to user preferences. @@ -58,13 +49,5 @@ - - - - Channels - - - - \ No newline at end of file diff --git a/src/Models/BravoOptions.cs b/src/Models/BravoOptions.cs index 74b5f503..2b786036 100644 --- a/src/Models/BravoOptions.cs +++ b/src/Models/BravoOptions.cs @@ -15,7 +15,6 @@ private BravoOptions(IUserSettings userSettings) { TelemetryEnabled = userSettings.TelemetryEnabled; DiagnosticLevel = userSettings.DiagnosticLevel; - UpdateChannel = userSettings.UpdateChannel; UpdateCheckEnabled = userSettings.UpdateCheckEnabled; Theme = userSettings.Theme; Proxy = userSettings.Proxy; @@ -30,9 +29,6 @@ private BravoOptions(IUserSettings userSettings) [JsonPropertyName("diagnosticLevel")] public DiagnosticLevelType DiagnosticLevel { get; set; } = UserSettings.DefaultDiagnosticLevel; - [JsonPropertyName("updateChannel")] - public UpdateChannelType UpdateChannel { get; set; } = UserSettings.DefaultUpdateChannel; - [JsonPropertyName("updateCheckEnabled")] public bool UpdateCheckEnabled { get; set; } = UserSettings.DefaultUpdateCheckEnabled; @@ -65,7 +61,6 @@ public void SaveToUserPreferences() { settings.TelemetryEnabled = TelemetryEnabled; settings.DiagnosticLevel = DiagnosticLevel; - settings.UpdateChannel = UpdateChannel; settings.UpdateCheckEnabled = UpdateCheckEnabled; settings.Theme = Theme; settings.Proxy = Proxy; diff --git a/src/Models/BravoUpdate.cs b/src/Models/BravoUpdate.cs index 17db1e94..319d2418 100644 --- a/src/Models/BravoUpdate.cs +++ b/src/Models/BravoUpdate.cs @@ -1,28 +1,11 @@ using System.Text.Json.Serialization; -using Sqlbi.Bravo.Infrastructure.Configuration.Settings; namespace Sqlbi.Bravo.Models; -public interface IUpdateInfo +public class BravoUpdate { - UpdateChannelType? UpdateChannel { get; set; } - - bool IsNewerVersion { get; set; } - - string? Version { get; set; } - - string? DownloadUrl { get; set; } - - string? ChangelogUrl { get; set; } -} - -public class BravoUpdate : IUpdateInfo -{ - [JsonPropertyName("updateChannel")] - public UpdateChannelType? UpdateChannel { get; set; } - [JsonPropertyName("isNewerVersion")] - public bool IsNewerVersion { get; set; } = false; + public bool IsNewerVersion { get; set; } [JsonPropertyName("version")] public string? Version { get; set; } diff --git a/src/Scripts/controllers/app.ts b/src/Scripts/controllers/app.ts index d311a31b..ba3f6a74 100644 --- a/src/Scripts/controllers/app.ts +++ b/src/Scripts/controllers/app.ts @@ -422,11 +422,11 @@ export class App { if (automatic && !optionsController.getOption("updateCheckEnabled")) return; - return host.getCurrentVersion(optionsController.getOption("updateChannel")) + return host.getCurrentVersion() .then(data => { let newVersion = null; - if (data.updateChannel == optionsController.getOption("updateChannel") && data.isNewerVersion) { + if (data.isNewerVersion) { newVersion = new AppVersion({ version: data.version, downloadUrl: data.downloadUrl, diff --git a/src/Scripts/controllers/host.ts b/src/Scripts/controllers/host.ts index 4e68ac07..b351ef47 100644 --- a/src/Scripts/controllers/host.ts +++ b/src/Scripts/controllers/host.ts @@ -13,7 +13,7 @@ import { /*TokenUpdateWebMessage,*/ WebMessage, WebMessageType } from '../model/ import { PBICloudDataset, PBICloudDatasetConnectionMode } from '../model/pbi-dataset'; import { FormattedMeasure, TabularDatabase, TabularDatabaseServer, TabularMeasure, TabularTable } from '../model/tabular'; import { Account, SignInRequest } from './auth'; -import { DiagnosticLevelType, FormatDaxOptions, Options, UpdateChannelType } from './options'; +import { DiagnosticLevelType, FormatDaxOptions, Options } from './options'; import { PBIDesktopReport, PBIDesktopReportConnectionMode } from '../model/pbi-report'; import { ThemeType } from './theme'; import { i18n } from '../model/i18n'; @@ -190,7 +190,6 @@ export interface CreateDateTemplateRequest { } export interface BravoUpdate { - updateChannel: UpdateChannelType version?: string downloadUrl?: string changelogUrl?: string @@ -625,8 +624,8 @@ export class Host extends Dispatchable { return >this.apiCall("api/GetDiagnostics", { after: after, max: max }); } - getCurrentVersion(updateChannel: UpdateChannelType) { - return >this.apiCall("api/GetCurrentVersion", { updateChannel: updateChannel }); + getCurrentVersion() { + return >this.apiCall("api/GetCurrentVersion"); } fileSystemOpen(path: string) { diff --git a/src/Scripts/controllers/options.ts b/src/Scripts/controllers/options.ts index 23fe7069..8e8b19bf 100644 --- a/src/Scripts/controllers/options.ts +++ b/src/Scripts/controllers/options.ts @@ -17,7 +17,6 @@ export interface Options { theme: ThemeType telemetryEnabled: boolean customTemplatesEnabled: boolean - updateChannel: UpdateChannelType updateCheckEnabled: boolean useSystemBrowserForAuthentication: boolean diagnosticLevel: DiagnosticLevelType @@ -27,7 +26,6 @@ export interface Options { export interface Policies { telemetryEnabled?: boolean | null - updateChannel?: UpdateChannelType | null updateCheckEnabled?: boolean | null useSystemBrowserForAuthentication?: boolean | null builtInTemplatesEnabled?: boolean | null @@ -98,13 +96,6 @@ export enum DaxFormatterSpacingStyle { NoSpaceAfterFunction = 1 } -export enum UpdateChannelType { - Stable = 0, - //Beta = 1, - Dev = 2, - //Canary = 3, -} - export enum DiagnosticLevelType { None = 0, Basic = 1, @@ -195,7 +186,6 @@ export class OptionsController extends OptionsStore { telemetryEnabled: true, customTemplatesEnabled: true, diagnosticLevel: DiagnosticLevelType.None, - updateChannel: UpdateChannelType.Stable, updateCheckEnabled: true, useSystemBrowserForAuthentication: false, proxy: { @@ -277,8 +267,8 @@ export class OptionsController extends OptionsStore { * (not a plain object) - in that case every option under that group inherits it. If the value found * is a plain object, it is a dictionary of per-child overrides: an exact-leaf match is required, * siblings that aren't explicitly configured are NOT locked by the rest of the group. - * E.g. (with policies = { updateChannel: 2, customOptions: { formatting: { preview: true } }, proxy: true }): - * - updateChannel -> 2 (scalar leaf match) + * E.g. (with policies = { telemetryEnabled: false, customOptions: { formatting: { preview: true } }, proxy: true }): + * - telemetryEnabled -> false (scalar leaf match) * - customOptions.formatting.preview -> true (scalar leaf match) * - customOptions.formatting.region -> undefined (sibling not configured - NOT locked) * - proxy.address -> true (proxy itself is a scalar - cascades to every child) diff --git a/src/Scripts/css/dialog.less b/src/Scripts/css/dialog.less index b119e842..23b150f6 100644 --- a/src/Scripts/css/dialog.less +++ b/src/Scripts/css/dialog.less @@ -399,7 +399,7 @@ .flexbox(center); .display-version { - margin: 0 5px; + margin-right: 5px; } .copy-version { &:before { diff --git a/src/Scripts/model/i18n/cz.ts b/src/Scripts/model/i18n/cz.ts index fdc76929..4daee9d6 100644 --- a/src/Scripts/model/i18n/cz.ts +++ b/src/Scripts/model/i18n/cz.ts @@ -451,10 +451,6 @@ const locale: Locale = { [_.toggleTree]: "Přepnout strom", [_.traceId]: "ID stopy", [_.unknownMessage]: "Byla přijata neplatná zpráva", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Prvotina", - [_.updateChannelDev]: "Vývoj", - [_.updateChannelStable]: "Stabilní", [_.updateMessage]: "K dispozici je nová verze Bravo: {version}", [_.validating]: "Ověřování...", [_.version]: "Verze", diff --git a/src/Scripts/model/i18n/da.ts b/src/Scripts/model/i18n/da.ts index 00fc1f27..2a6262bb 100644 --- a/src/Scripts/model/i18n/da.ts +++ b/src/Scripts/model/i18n/da.ts @@ -451,10 +451,6 @@ const locale: Locale = { [_.toggleTree]: "Skift træ", [_.traceId]: "Sproings-id", [_.unknownMessage]: "Ugyldig besked modtagetd", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stable", [_.updateMessage]: "En ny version af Bravo er tilgængelig: {version}", [_.validating]: "Validerer...", [_.version]: "Version", diff --git a/src/Scripts/model/i18n/de.ts b/src/Scripts/model/i18n/de.ts index 79b5c128..159bc1f3 100644 --- a/src/Scripts/model/i18n/de.ts +++ b/src/Scripts/model/i18n/de.ts @@ -453,10 +453,6 @@ const locale: Locale = { [_.toggleTree]: "Baum umschalten", [_.traceId]: "Trace-ID", [_.unknownMessage]: "Ungültige Meldung erhalten", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stable", [_.updateMessage]: "Eine neue Version von Bravo ist verfügbar: {version}", [_.validating]: "Überprüfe...", [_.version]: "Version", diff --git a/src/Scripts/model/i18n/en.ts b/src/Scripts/model/i18n/en.ts index 56a283ad..f9cc269d 100644 --- a/src/Scripts/model/i18n/en.ts +++ b/src/Scripts/model/i18n/en.ts @@ -454,10 +454,6 @@ const locale: Locale = { [_.toggleTree]: "Toggle Tree", [_.traceId]: "Trace Id", [_.unknownMessage]: "Invalid Message Received", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stable", [_.updateMessage]: "A new version of Bravo is available: {version}", [_.validating]: "Validating...", [_.version]: "Version", diff --git a/src/Scripts/model/i18n/es.ts b/src/Scripts/model/i18n/es.ts index 90669052..f6f1fb9f 100644 --- a/src/Scripts/model/i18n/es.ts +++ b/src/Scripts/model/i18n/es.ts @@ -450,10 +450,6 @@ const locale: Locale = { [_.toggleTree]: "Desplegar árbol", [_.traceId]: "Rastro ID", [_.unknownMessage]: "Mensaje inválido recibido", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Test de producción", - [_.updateChannelDev]: "Desarrollo", - [_.updateChannelStable]: "Estable", [_.updateMessage]: "Una nueva versión de Bravo está disponible: {versión}", [_.validating]: "Validando...", [_.version]: "Versión", diff --git a/src/Scripts/model/i18n/fa.ts b/src/Scripts/model/i18n/fa.ts index bd9d4392..837f1d15 100644 --- a/src/Scripts/model/i18n/fa.ts +++ b/src/Scripts/model/i18n/fa.ts @@ -455,10 +455,6 @@ const locale: Locale = { [_.toggleTree]: "مشاهده در نمای درختی", [_.traceId]: "شناسه ردیابی", [_.unknownMessage]: "خطای نامعتبر دریافت شد", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stable", [_.updateMessage]: "نسخه جدید در دسترس می باشد: {version}", [_.validating]: "اعتبارسنجی...", [_.version]: "نسخه", diff --git a/src/Scripts/model/i18n/fr.ts b/src/Scripts/model/i18n/fr.ts index 22e5ce88..10168a5a 100644 --- a/src/Scripts/model/i18n/fr.ts +++ b/src/Scripts/model/i18n/fr.ts @@ -453,10 +453,6 @@ const locale: Locale = { [_.toggleTree]: "Basculer l'arborescence", [_.traceId]: "Identifiant de suivi", [_.unknownMessage]: "Message non valide reçu", - [_.updateChannelBeta]: "Bêta", - [_.updateChannelCanary]: "Canari", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stable", [_.updateMessage]: "Une nouvelle version de Bravo est disponible: {version}", [_.validating]: "Validation...", [_.version]: "Version", diff --git a/src/Scripts/model/i18n/gr.ts b/src/Scripts/model/i18n/gr.ts index f19c1f28..b12e984d 100644 --- a/src/Scripts/model/i18n/gr.ts +++ b/src/Scripts/model/i18n/gr.ts @@ -451,10 +451,6 @@ const locale: Locale = { [_.toggleTree]: "Εναλλαγή σε δέντρο", [_.traceId]: "Αριθμός ίχνους", [_.unknownMessage]: "Ένα μη έγκυρο μήνυμα λήφθηκε", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stable", [_.updateMessage]: "Μια νέα έκδοση του Bravo είναι διαθέσιμη: {version}", [_.validating]: "Έλεγχος εγκυρότητας...", [_.version]: "Έκδοση", diff --git a/src/Scripts/model/i18n/it.ts b/src/Scripts/model/i18n/it.ts index 3e886e0e..169fbca8 100644 --- a/src/Scripts/model/i18n/it.ts +++ b/src/Scripts/model/i18n/it.ts @@ -451,10 +451,6 @@ const locale: Locale = { [_.toggleTree]: "Cambia Visualizzazione", [_.traceId]: "Trace Id", [_.unknownMessage]: "Messaggio Non Valido", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stable", [_.updateMessage]: "Una nuova versione di Bravo è disponibile: {version}", [_.validating]: "Validazione in corso...", [_.version]: "Versione", diff --git a/src/Scripts/model/i18n/nl.ts b/src/Scripts/model/i18n/nl.ts index d608bd81..664f6ea7 100644 --- a/src/Scripts/model/i18n/nl.ts +++ b/src/Scripts/model/i18n/nl.ts @@ -451,10 +451,6 @@ const locale: Locale = { [_.toggleTree]: "Schakelboom", [_.traceId]: "Traceer Id", [_.unknownMessage]: "Ongeldig bericht ontvangen", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stabiel", [_.updateMessage]: "Een nieuwere versie van Bravo is beschikbaar: {version}", [_.validating]: "Valideren...", [_.version]: "Versie", diff --git a/src/Scripts/model/i18n/pl.ts b/src/Scripts/model/i18n/pl.ts index 05a39000..520da2c2 100644 --- a/src/Scripts/model/i18n/pl.ts +++ b/src/Scripts/model/i18n/pl.ts @@ -451,10 +451,6 @@ const locale: Locale = { [_.toggleTree]: "Przełącz widok drzewa", [_.traceId]: "Trace Id", [_.unknownMessage]: "Odebrano nieprawidłowy komunikat", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stabilna", [_.updateMessage]: "Dostępna jest nowa wersja Bravo: {version}", [_.validating]: "Walidacja...", [_.version]: "Wersja", diff --git a/src/Scripts/model/i18n/pt.ts b/src/Scripts/model/i18n/pt.ts index 1eff8a08..644e32ae 100644 --- a/src/Scripts/model/i18n/pt.ts +++ b/src/Scripts/model/i18n/pt.ts @@ -450,10 +450,6 @@ const locale: Locale = { [_.toggleTree]: "Alternar Árvore", [_.traceId]: "Id de Rastreio", [_.unknownMessage]: "Recebida Mensagem Inválida", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Estável", [_.updateMessage]: "Está disponível uma nova versão do Bravo: {version}", [_.validating]: "A validar...", [_.version]: "Versão", diff --git a/src/Scripts/model/i18n/ru.ts b/src/Scripts/model/i18n/ru.ts index 3474cf49..82b25128 100644 --- a/src/Scripts/model/i18n/ru.ts +++ b/src/Scripts/model/i18n/ru.ts @@ -451,10 +451,6 @@ const locale: Locale = { [_.toggleTree]: "Переключить древо", [_.traceId]: "Id трассировки", [_.unknownMessage]: "Получено недопустимое сообщение", - [_.updateChannelBeta]: "Бета", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Стабильный", [_.updateMessage]: "Доступна новая версия Bravo: {version}", [_.validating]: "Проверка...", [_.version]: "Версия", diff --git a/src/Scripts/model/i18n/tr.ts b/src/Scripts/model/i18n/tr.ts index 14776158..89c9cb78 100644 --- a/src/Scripts/model/i18n/tr.ts +++ b/src/Scripts/model/i18n/tr.ts @@ -453,10 +453,6 @@ const locale: Locale = { [_.toggleTree]: "Kırılımı Aç/Kapat", [_.traceId]: "İzleme Kimliği", [_.unknownMessage]: "Geçersiz Mesaj Alındı", - [_.updateChannelBeta]: "Beta", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Stabil", [_.updateMessage]: "Bravo'nun yeni bir sürümü mevcut: {version}", [_.validating]: "Doğrulanıyor...", [_.version]: "Sürüm", diff --git a/src/Scripts/model/i18n/uk.ts b/src/Scripts/model/i18n/uk.ts index c976af2e..ef17fbcf 100644 --- a/src/Scripts/model/i18n/uk.ts +++ b/src/Scripts/model/i18n/uk.ts @@ -452,10 +452,6 @@ const locale: Locale = { [_.toggleTree]: "Переключити древо", [_.traceId]: "Ідентифікатор відстеження", [_.unknownMessage]: "Отримано невірне повідомлення", - [_.updateChannelBeta]: "Бета", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "Dev", - [_.updateChannelStable]: "Стабільний", [_.updateMessage]: "Доступна нова версія Bravo: {version}", [_.validating]: "Перевірка...", [_.version]: "Версія", diff --git a/src/Scripts/model/i18n/zh.ts b/src/Scripts/model/i18n/zh.ts index 20bf6cc1..e94563b5 100644 --- a/src/Scripts/model/i18n/zh.ts +++ b/src/Scripts/model/i18n/zh.ts @@ -451,10 +451,6 @@ const locale: Locale = { [_.toggleTree]: "切换树形图", [_.traceId]: "跟踪ID", [_.unknownMessage]: "收到的信息无效", - [_.updateChannelBeta]: "测试版", - [_.updateChannelCanary]: "Canary", - [_.updateChannelDev]: "开发版", - [_.updateChannelStable]: "稳定版", [_.updateMessage]: "Bravo有可用的新版本: {version}", [_.validating]: "正在验证...", [_.version]: "版本", diff --git a/src/Scripts/model/strings.ts b/src/Scripts/model/strings.ts index eb220a5a..fd580d9a 100644 --- a/src/Scripts/model/strings.ts +++ b/src/Scripts/model/strings.ts @@ -446,10 +446,6 @@ export enum strings { toggleTree, traceId, unknownMessage, - updateChannelBeta, - updateChannelCanary, - updateChannelDev, - updateChannelStable, updateMessage, validating, version, diff --git a/src/Scripts/view/options-dialog-about.ts b/src/Scripts/view/options-dialog-about.ts index 6ae5ccba..57edf41a 100644 --- a/src/Scripts/view/options-dialog-about.ts +++ b/src/Scripts/view/options-dialog-about.ts @@ -5,7 +5,6 @@ */ import { AppVersion } from '../controllers/app'; -import { UpdateChannelType } from '../controllers/options'; import { Loader } from '../helpers/loader'; import { _, __ } from '../helpers/utils'; import { app, logger, optionsController, themeController } from '../main'; @@ -17,10 +16,6 @@ export class OptionsDialogAbout { updateStatusDiv: HTMLElement; - get canChangeChannel() { - return !optionsController.optionIsPolicyLocked("updateChannel"); - } - get canChangeCheckForUpdates() { return !optionsController.optionIsPolicyLocked("updateCheckEnabled"); } @@ -39,11 +34,6 @@ export class OptionsDialogAbout {

${i18n(strings.appName)}

-   ${i18n(strings.appVersion, { version: app.currentVersion.info.version})}
@@ -51,7 +41,7 @@ export class OptionsDialogAbout {
- ${!this.canChangeChannel || !this.canChangeCheckForUpdates ? ` + ${!this.canChangeCheckForUpdates ? `
${i18n(strings.optionPolicyNotice)}
@@ -73,14 +63,6 @@ export class OptionsDialogAbout { element.insertAdjacentHTML("beforeend", html); this.updateStatusDiv = _(".update-status", element); - _("#option-updatechannel", element).addEventListener("change", e => { - if (!this.canChangeChannel) return; - - let el = e.currentTarget; - optionsController.update("updateChannel", Number(el.value)); - this.checkForUpdates(true); - }); - _(".copy-version", element).addEventListener("click", e => { e.preventDefault(); navigator.clipboard.writeText(app.currentVersion.toString()); @@ -96,7 +78,7 @@ export class OptionsDialogAbout { this.checkForUpdates(); } - checkForUpdates(force = false) { + checkForUpdates() { if (!this.canCheckForUpdates) return; const statusHtml = (newVersion: AppVersion) => @@ -110,7 +92,7 @@ export class OptionsDialogAbout {
${i18n(strings.appUpToDate)}
`; - if (!app.newVersion || force) { + if (!app.newVersion) { this.updateStatusDiv.innerHTML = Loader.html(false, false, 5); diff --git a/test/Bravo.Tests/Infrastructure/Extensions/CommonExtensionsTests.cs b/test/Bravo.Tests/Infrastructure/Extensions/CommonExtensionsTests.cs index 1187b207..832a2e24 100644 --- a/test/Bravo.Tests/Infrastructure/Extensions/CommonExtensionsTests.cs +++ b/test/Bravo.Tests/Infrastructure/Extensions/CommonExtensionsTests.cs @@ -9,8 +9,8 @@ public class CommonExtensionsTests [Fact] public void TryParseTo_IntTest() { - var expected = UpdateChannelType.Dev; - var actual = EnumExtensions.TryParseTo((int)expected); + var expected = DiagnosticLevelType.Verbose; + var actual = EnumExtensions.TryParseTo((int)expected); Assert.Equal(expected, actual); } @@ -18,14 +18,14 @@ public void TryParseTo_IntTest() [Fact] public void TryParseTo_IntNullTest1() { - var @enum = EnumExtensions.TryParseTo((int?)null); + var @enum = EnumExtensions.TryParseTo((int?)null); Assert.Null(@enum); } [Fact] public void TryParseTo_IntNullTest2() { - var @enum = EnumExtensions.TryParseTo(int.MaxValue); + var @enum = EnumExtensions.TryParseTo(int.MaxValue); Assert.Null(@enum); } } diff --git a/test/Bravo.Tests/Infrastructure/Policies/RegistryPolicyReaderTests.cs b/test/Bravo.Tests/Infrastructure/Policies/RegistryPolicyReaderTests.cs index b85e9941..100d0d22 100644 --- a/test/Bravo.Tests/Infrastructure/Policies/RegistryPolicyReaderTests.cs +++ b/test/Bravo.Tests/Infrastructure/Policies/RegistryPolicyReaderTests.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Sqlbi.Bravo.Infrastructure.Configuration.Settings; using Sqlbi.Bravo.Infrastructure.Policies; using Xunit; @@ -25,7 +24,6 @@ public void FromSource_EmptySource_AllPropertiesAreNull() var policies = RegistryPolicyReader.FromSource(new FakePolicySource()); Assert.Null(policies.TelemetryEnabled); - Assert.Null(policies.UpdateChannel); Assert.Null(policies.UpdateCheckEnabled); Assert.Null(policies.UseSystemBrowserForAuthentication); Assert.Null(policies.BuiltInTemplatesEnabled); @@ -81,40 +79,6 @@ public void FromSource_BoolPolicyNonIntValue_ReturnsNull(string propertyName) Assert.Null(GetBoolProperty(policies, propertyName)); } - [Fact] - public void FromSource_UpdateChannelDefinedEnumValue_ReturnsParsedValue() - { - var source = new FakePolicySource(); - source.Set("UpdateChannel", (int)UpdateChannelType.Dev); - - var policies = RegistryPolicyReader.FromSource(source); - - Assert.Equal(UpdateChannelType.Dev, policies.UpdateChannel); - } - - [Fact] - public void FromSource_UpdateChannelUndefinedEnumValue_ReturnsNull() - { - // 1 is not a defined UpdateChannelType member (Beta is reserved/commented out) - must not be misparsed - var source = new FakePolicySource(); - source.Set("UpdateChannel", 1); - - var policies = RegistryPolicyReader.FromSource(source); - - Assert.Null(policies.UpdateChannel); - } - - [Fact] - public void FromSource_UpdateChannelNonIntValue_ReturnsNull() - { - var source = new FakePolicySource(); - source.Set("UpdateChannel", "Dev"); - - var policies = RegistryPolicyReader.FromSource(source); - - Assert.Null(policies.UpdateChannel); - } - [Fact] public void FromSource_CustomTemplatesOrganizationRepositoryPathStringValueSet_ReturnsValue() { @@ -139,7 +103,6 @@ public void FromSource_CustomTemplatesOrganizationRepositoryPathNonStringValue_R private static readonly PolicySnapshot AllNull = new( TelemetryEnabled: null, - UpdateChannel: null, UpdateCheckEnabled: null, UseSystemBrowserForAuthentication: null, BuiltInTemplatesEnabled: null, @@ -171,13 +134,12 @@ public void Merge_OnlyUserValueSet_ReturnsUserValue() [Fact] public void Merge_BothSet_MachineTakesPrecedenceOverUser() { - var machine = AllNull with { TelemetryEnabled = true, UpdateChannel = UpdateChannelType.Stable, UpdateCheckEnabled = false }; - var user = AllNull with { TelemetryEnabled = false, UpdateChannel = UpdateChannelType.Dev, UpdateCheckEnabled = true }; + var machine = AllNull with { TelemetryEnabled = true, UpdateCheckEnabled = false }; + var user = AllNull with { TelemetryEnabled = false, UpdateCheckEnabled = true }; var merged = RegistryPolicyReader.Merge(machine, user); Assert.True(merged.TelemetryEnabled); - Assert.Equal(UpdateChannelType.Stable, merged.UpdateChannel); Assert.False(merged.UpdateCheckEnabled); } @@ -193,11 +155,10 @@ public void Merge_NeitherSet_ReturnsNull() public void Merge_EachPropertyResolvedIndependently() { // Guards against a copy-paste wiring mistake in Merge() (e.g. reading the wrong - // property from machine/user) by exercising all 7 properties in a single assertion, + // property from machine/user) by exercising all 6 properties in a single assertion, // each with a distinct machine/user combination. var machine = new PolicySnapshot( TelemetryEnabled: true, - UpdateChannel: null, UpdateCheckEnabled: null, UseSystemBrowserForAuthentication: true, BuiltInTemplatesEnabled: null, @@ -206,7 +167,6 @@ public void Merge_EachPropertyResolvedIndependently() var user = new PolicySnapshot( TelemetryEnabled: false, // machine wins - UpdateChannel: UpdateChannelType.Dev, // machine unset -> user wins UpdateCheckEnabled: true, // machine unset -> user wins UseSystemBrowserForAuthentication: false, // machine wins BuiltInTemplatesEnabled: false, // machine unset -> user wins @@ -216,7 +176,6 @@ public void Merge_EachPropertyResolvedIndependently() var merged = RegistryPolicyReader.Merge(machine, user); Assert.True(merged.TelemetryEnabled); - Assert.Equal(UpdateChannelType.Dev, merged.UpdateChannel); Assert.True(merged.UpdateCheckEnabled); Assert.True(merged.UseSystemBrowserForAuthentication); Assert.False(merged.BuiltInTemplatesEnabled);