Skip to content

Commit

Permalink
Merge pull request #2887 from Flow-Launcher/dev
Browse files Browse the repository at this point in the history
Release 1.19.0 | Plugin 4.4.0
  • Loading branch information
jjw24 authored Aug 16, 2024
2 parents 7ea5c68 + eec252e commit 4fc3030
Show file tree
Hide file tree
Showing 373 changed files with 21,055 additions and 12,615 deletions.
77 changes: 77 additions & 0 deletions .cm/gitstream.cm
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# -*- mode: yaml -*-
# This example configuration for provides basic automations to get started with gitStream.
# View the gitStream quickstart for more examples: https://docs.gitstream.cm/examples/
manifest:
version: 1.0


triggers:
exclude:
branch:
- l10n_dev
- dev


automations:
# Add a label that indicates how many minutes it will take to review the PR.
estimated_time_to_review:
if:
- true
run:
- action: add-label@v1
args:
label: "{{ calc.etr }} min review"
color: {{ colors.red if (calc.etr >= 20) else ( colors.yellow if (calc.etr >= 5) else colors.green ) }}
# Post a comment that lists the best experts for the files that were modified.
explain_code_experts:
if:
- true
run:
- action: explain-code-experts@v1
args:
gt: 10
# Post a comment notifying that the PR contains a TODO statement.
review_todo_comments:
if:
- {{ source.diff.files | matchDiffLines(regex=r/^[+].*\b(TODO|todo)\b/) | some }}
run:
- action: add-comment@v1
args:
comment: |
This PR contains a TODO statement. Please check to see if they should be removed.
# Post a comment that request a before and after screenshot
request_screenshot:
# Triggered for PRs that lack an image file or link to an image in the PR description
if:
- {{ not (has.screenshot_link or has.image_uploaded) }}
run:
- action: add-comment@v1
args:
comment: |
Be a legend :trophy: by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.
# +----------------------------------------------------------------------------+
# | Custom Expressions |
# | https://docs.gitstream.cm/how-it-works/#custom-expressions |
# +----------------------------------------------------------------------------+

calc:
etr: {{ branch | estimatedReviewTime }}

colors:
red: 'b60205'
yellow: 'fbca04'
green: '0e8a16'

changes:
# Sum all the lines added/edited in the PR
additions: {{ branch.diff.files_metadata | map(attr='additions') | sum }}
# Sum all the line removed in the PR
deletions: {{ branch.diff.files_metadata | map(attr='deletions') | sum }}
# Calculate the ratio of new code
ratio: {{ (changes.additions / (changes.additions + changes.deletions)) * 100 | round(2) }}

has:
screenshot_link: {{ pr.description | includes(regex=r/!\[.*\]\(.*(jpg|svg|png|gif|psd).*\)/) }}
image_uploaded: {{ pr.description | includes(regex=r/(<img.*src.*(jpg|svg|png|gif|psd).*>)|!\[image\]\(.*github\.com.*\)/) }}
3 changes: 3 additions & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ https
ssh
ubuntu
runcount
Firefox
Português
Português (Brasil)
3 changes: 3 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ WCA_ACCENT_POLICY
HGlobal
dopusrt
firefox
Firefox
msedge
svgc
ime
Expand All @@ -97,6 +98,8 @@ Português
Português (Brasil)
Italiano
Slovenský
quicklook
Tiếng Việt
Droplex
Preinstalled
errormetadatafile
Expand Down
31 changes: 31 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# The bot always updates the labels, add/remove as necessary [default: false]
alwaysReplace: false
# Treats the text and labels as case sensitive [default: true]
caseSensitive: false
# Array of labels to be applied to the PR [default: []]
customLabels:
# Finds the `text` within the PR title and body and applies the `label`
- text: 'bug'
label: 'bug'
- text: 'fix'
label: 'bug'
- text: 'dependabot'
label: 'bug'
- text: 'New Crowdin updates'
label: 'bug'
- text: 'New Crowdin updates'
label: 'kind/i18n'
- text: 'feature'
label: 'enhancement'
- text: 'add new'
label: 'enhancement'
- text: 'refactor'
label: 'enhancement'
- text: 'refactor'
label: 'Code Refactor'
# Search the body of the PR for the `text` [default: true]
searchBody: true
# Search the title of the PR for the `text` [default: true]
searchTitle: true
# Search for whole words only [default: false]
wholeWords: false
49 changes: 49 additions & 0 deletions .github/workflows/gitstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Code generated by gitStream GitHub app - DO NOT EDIT

name: gitStream workflow automation
run-name: |
/:\ gitStream: PR #${{ fromJSON(fromJSON(github.event.inputs.client_payload)).pullRequestNumber }} from ${{ github.event.inputs.full_repository }}
on:
workflow_dispatch:
inputs:
client_payload:
description: The Client payload
required: true
full_repository:
description: the repository name include the owner in `owner/repo_name` format
required: true
head_ref:
description: the head sha
required: true
base_ref:
description: the base ref
required: true
installation_id:
description: the installation id
required: false
resolver_url:
description: the resolver url to pass results to
required: true
resolver_token:
description: Optional resolver token for resolver service
required: false
default: ''

jobs:
gitStream:
timeout-minutes: 5
runs-on: ubuntu-latest
name: gitStream workflow automation
steps:
- name: Evaluate Rules
uses: linear-b/gitstream-github-action@v2
id: rules-engine
with:
full_repository: ${{ github.event.inputs.full_repository }}
head_ref: ${{ github.event.inputs.head_ref }}
base_ref: ${{ github.event.inputs.base_ref }}
client_payload: ${{ github.event.inputs.client_payload }}
installation_id: ${{ github.event.inputs.installation_id }}
resolver_url: ${{ github.event.inputs.resolver_url }}
resolver_token: ${{ github.event.inputs.resolver_token }}
19 changes: 19 additions & 0 deletions .github/workflows/pr_assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Assign PR to creator

# Due to GitHub token limitation, only able to assign org members not authors from forks.
# https://github.com/thomaseizinger/assign-pr-creator-action/issues/3

on:
pull_request:
types: [opened]
branches-ignore:
- l10n_dev

jobs:
automation:
runs-on: ubuntu-latest
steps:
- name: Assign PR to creator
uses: thomaseizinger/assign-pr-creator-action@v1.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/pr_milestone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Set Milestone

# Assigns the earliest created milestone that matches the below glob pattern.

on:
pull_request:
types: [opened]

jobs:
automation:
runs-on: ubuntu-latest

steps:
- name: set-milestone
uses: andrefcdias/add-to-milestone@v1.3.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
milestone: "+([0-9]).+([0-9]).+([0-9])"
use-expression: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.IO;
using System.Linq;
using System.Windows.Forms;
using Flow.Launcher.Core.Resource;

namespace Flow.Launcher.Core.ExternalPlugins.Environments
{
Expand Down Expand Up @@ -50,14 +51,15 @@ internal IEnumerable<PluginPair> Setup()
return SetPathForPluginPairs(PluginsSettingsFilePath, Language);
}

if (MessageBox.Show($"Flow detected you have installed {Language} plugins, which " +
$"will require {EnvName} to run. Would you like to download {EnvName}? " +
Environment.NewLine + Environment.NewLine +
"Click no if it's already installed, " +
$"and you will be prompted to select the folder that contains the {EnvName} executable",
string.Empty, MessageBoxButtons.YesNo) == DialogResult.No)
var noRuntimeMessage = string.Format(
InternationalizationManager.Instance.GetTranslation("runtimePluginInstalledChooseRuntimePrompt"),
Language,
EnvName,
Environment.NewLine
);
if (MessageBox.Show(noRuntimeMessage, string.Empty, MessageBoxButtons.YesNo) == DialogResult.No)
{
var msg = $"Please select the {EnvName} executable";
var msg = string.Format(InternationalizationManager.Instance.GetTranslation("runtimePluginChooseRuntimeExecutable"), EnvName);
string selectedFile;

selectedFile = GetFileFromDialog(msg, FileDialogFilter);
Expand All @@ -80,8 +82,7 @@ internal IEnumerable<PluginPair> Setup()
}
else
{
MessageBox.Show(
$"Unable to set {Language} executable path, please try from Flow's settings (scroll down to the bottom).");
MessageBox.Show(string.Format(InternationalizationManager.Instance.GetTranslation("runtimePluginUnableToSetExecutablePath"), Language));
Log.Error("PluginsLoader",
$"Not able to successfully set {EnvName} path, setting's plugin executable path variable is still an empty string.",
$"{Language}Environment");
Expand Down
4 changes: 3 additions & 1 deletion Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace Flow.Launcher.Core.ExternalPlugins
{
Expand All @@ -13,9 +13,11 @@ public record UserPlugin
public string Website { get; set; }
public string UrlDownload { get; set; }
public string UrlSourceCode { get; set; }
public string LocalInstallPath { get; set; }
public string IcoPath { get; set; }
public DateTime? LatestReleaseDate { get; set; }
public DateTime? DateAdded { get; set; }

public bool IsFromLocalInstallPath => !string.IsNullOrEmpty(LocalInstallPath);
}
}
8 changes: 4 additions & 4 deletions Flow.Launcher.Core/Flow.Launcher.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@

<ItemGroup>
<PackageReference Include="Droplex" Version="1.7.0" />
<PackageReference Include="FSharp.Core" Version="7.0.401" />
<PackageReference Include="Meziantou.Framework.Win32.Jobs" Version="3.2.1" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageReference Include="FSharp.Core" Version="8.0.301" />
<PackageReference Include="Meziantou.Framework.Win32.Jobs" Version="3.4.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="squirrel.windows" Version="1.5.2" NoWarn="NU1701" />
<PackageReference Include="StreamJsonRpc" Version="2.17.11" />
<PackageReference Include="StreamJsonRpc" Version="2.18.48" />
</ItemGroup>

<ItemGroup>
Expand Down
17 changes: 13 additions & 4 deletions Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,20 @@ public virtual Task ReloadDataAsync()
return Task.CompletedTask;
}

public virtual ValueTask DisposeAsync()
public virtual async ValueTask DisposeAsync()
{
RPC?.Dispose();
ErrorStream?.Dispose();
return ValueTask.CompletedTask;
try
{
await RPC.InvokeAsync("close");
}
catch (RemoteMethodNotFoundException e)
{
}
finally
{
RPC?.Dispose();
ErrorStream?.Dispose();
}
}
}
}
Loading

0 comments on commit 4fc3030

Please sign in to comment.