Create prompt to document code snippet

Dear @CoderCookE,
I have added a new feature to the vim-chatgpt repository that enhances the functionality of the plugin. This feature introduces the :Document command, which allows users to quickly create documentation for your code.
Please review and merge this pull request at your earliest convenience. Feel free to provide any feedback or suggestions for improvement.
Thank you for maintaining this repository and considering my contribution.
Best regards,

I wanted to share my thoughts on the new "Document" code feature. I believe the "Ask" command already serves a similar purpose, and considering the diverse programming languages and documentation styles we use, the implementation of the "Document" code might not be very beneficial. Each developer might have their preferred way of documenting code, be it using /// or /* patterns for Doxygen documentation.
Considering these points, I would like to suggest that we reevaluate the necessity of the "Document" code feature. Instead, we could encourage users to create custom functions in their .vimrc files that suit their specific requirements. This way, developers can tailor their documentation approach to their liking, leading to a more flexible and personalized coding experience.

I wanted to share my thoughts on the new "Document" code feature. I believe the "Ask" command already serves a similar purpose, and considering the diverse programming languages and documentation styles we use, the implementation of the "Document" code might not be very beneficial. Each developer might have their preferred way of documenting code, be it using /// or /* patterns for Doxygen documentation.
Considering these points, I would like to suggest that we reevaluate the necessity of the "Document" code feature. Instead, we could encourage users to create custom functions in their .vimrc files that suit their specific requirements. This way, developers can tailor their documentation approach to their liking, leading to a more flexible and personalized coding experience.

I'm adding the "Document" command because I've personally used ChatGPT to assist me with code documentation, and I believe it could be beneficial for other users as well. Following your logic, commands like Review, Rewrite, Explain, Test, etc., can also be achieved using the "Ask" command.
Regarding the concern about different documentation patterns for each programming language, I can be more specific in the input. I conducted some tests using the command "Identify language from this code snippet and returns documentation following the language pattern," and I successfully tested it with Elixir, TypeScript, Ruby, among others.

I do like the idea of "User defined functions", I think updating the documentation for "Adding your own functions" and finding a way to include them in the menu would be a useful addition.  The intention of the plug-in is to give some "helpful out of the box functionality", I think documentation is generic enough to be included.


AppBar title padding inconsistencies with leading Icon and titleSpacing

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Steps to reproduce

AppBar with title
Test title left padding with and without leading icon
Test every combination with and without titleSpacing = 0

Expected results
Title has expected padding with and without leading icon:
https://m3.material.io/components/top-app-bar/specs#2be41d8e-79cf-4f1a-abc1-962744ca9291
Actual results
Title either has the right padding for when there's no leading Icon, but too much padding when there is an Icon,
or the inverse when specifying titleSpacing = 0.
Code sample
Code sample
import 'package:flutter/material.dart';

void main() => runApp(const ScaffoldExampleApp());

class ScaffoldExampleApp extends StatelessWidget {
  const ScaffoldExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('App Bar'),
          leading: IconButton(
            icon: const Icon(Icons.menu),
            onPressed: () {},
          ),
          actions: <Widget>[
            IconButton(icon: const Icon(Icons.more_vert), onPressed: () {}),
          ],
          titleSpacing: 0,
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

titleSpacing default
titleSpacing = 0

With leading Icon
Wrong:
Right:

Without leading Icon
Right:
Wrong:

Flutter Doctor output
Doctor output
[√] Flutter (Channel stable, 3.13.4, on Microsoft Windows [Version 10.0.22621.2283], locale en-GB)
    • Flutter version 3.13.4 on channel stable at X:\Dev\Libraries\Flutter\stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (5 days ago), 2023-09-12 23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at X:\Dev\Libraries\Android\SDK
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = X:\Dev\Libraries\Android\SDK
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.7.34031.279
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.82.2)
    • VS Code at C:\Users\pirot\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.72.0

[√] Connected device (4 available)
    • KB2003 (mobile)   • 2a612a9e • android-arm64  • Android 13 (API 33)
    • Windows (desktop) • windows  • windows-x64    • Microsoft Windows [Version 10.0.22621.2283]
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 117.0.5938.89
    • Edge (web)        • edge     • web-javascript • Microsoft Edge 116.0.1938.62

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.```

</details>

This also applies to SliverAppBar.

Hi @FauconSpartiate, just to be sure, do you expect the title text to have no space between it and the leading icon when the titleSpacing is 0?

@danagbemava-nc
No, I'm expecting the padding to adhere to material spec with the default settings.
The default settings have the right padding when there is no icon, but too much padding when there is an icon.
When changing titleSpacing to 0, the padding with icon is correct, but the padding without icon is off.
Refer to the screenshots, where the screenshots on the top right and bottom left are how it should look like.
Refer to Material spec: https://m3.material.io/components/top-app-bar/specs#2be41d8e-79cf-4f1a-abc1-962744ca9291

Thanks for the update.
Reproducible using the code sample shared above.

flutter doctor -v
[!] Flutter (Channel stable, 3.13.4, on macOS 13.5.2 22G91 darwin-arm64, locale en-GB)
    • Flutter version 3.13.4 on channel stable at /Users/nexus/dev/sdks/flutter
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutters/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter. Consider adding /Users/nexus/dev/sdks/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutters/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter. Consider adding /Users/nexus/dev/sdks/flutter/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (6 days ago), 2023-09-12 23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Users/nexus/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode-15.0.0-Release.Candidate.app/Contents/Developer
    • Build 15A240d
    ✗ Unable to get list of installed Simulator runtimes.
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Users/nexus/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
    • IntelliJ at /Users/nexus/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 75.1.4
    • Dart plugin version 232.9559.10

[✓] VS Code (version 1.82.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.72.0

[✓] Connected device (4 available)
    • Pixel 7 (mobile) • 28291FDH2001SA            • android-arm64  • Android 13 (API 33)
    • Nexus (mobile)   • 00008020-001875E83A38002E • ios            • iOS 17.0 21A329
    • macOS (desktop)  • macos                     • darwin-arm64   • macOS 13.5.2 22G91 darwin-arm64
    • Chrome (web)     • chrome                    • web-javascript • Google Chrome 117.0.5938.88
    ! Error: Browsing on the local area network for Dean’s iPad. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.

[✓] Flutter (Channel master, 3.14.0-14.0.pre.358, on macOS 13.5.2 22G91 darwin-arm64, locale en-GB)
    • Flutter version 3.14.0-14.0.pre.358 on channel master at /Users/nexus/dev/sdks/flutters
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision<PHONE_NUMBER> (50 minutes ago), 2023-09-19 02:10:24 -0400
    • Engine revision 589bde9a95
    • Dart version 3.2.0 (build 3.2.0-174.0.dev)
    • DevTools version 2.28.0-dev.8

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Users/nexus/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode-15.0.0-Release.Candidate.app/Contents/Developer
    • Build 15A240d
    ✗ Unable to get list of installed Simulator runtimes.
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Users/nexus/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
    • IntelliJ at /Users/nexus/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 75.1.4
    • Dart plugin version 232.9559.10

[✓] VS Code (version 1.82.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.72.0

[✓] Connected device (4 available)
    • Pixel 7 (mobile) • 28291FDH2001SA            • android-arm64  • Android 13 (API 33)
    • Nexus (mobile)   • 00008020-001875E83A38002E • ios            • iOS 17.0 21A329
    • macOS (desktop)  • macos                     • darwin-arm64   • macOS 13.5.2 22G91 darwin-arm64
    • Chrome (web)     • chrome                    • web-javascript • Google Chrome 117.0.5938.88
    ! Error: Browsing on the local area network for Dean’s iPad. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

This is an old behavior. While it is true that by default there is extra padding when we have a leading icon.
Updating this will produce a whole lot of golden changes. Might break the AppBar widget on some devices and in nested layouts.
Solution
This can be easily customized with the titleSpacing parameter.  You can remove extra padding when you have the leading icon and not remove padding when there is no leading icon.

Given the comment above I feel safe to close this.


fix(client): remove social media icons background

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
[x] My changes do not use shortened URLs or affiliate links.

Closes #37410 by removing background-color change (setting background-color to transparent) on social media icons hover and focus state. I leave the subtle color change intact since it is derived from bootstrap default behavior.
I had tested this on my local dev with both day and night mode.

Thanks for the PR and taking a look at this @rickysyamsi - but there's already a PR for this issue. We will be going with that one, and not merging this. Thanks and happy coding! 🎉


lib.packagesFromDirectoryRecursive: refactor (v2)

Second go at #359941
An assertion was too restrictive and broke the installer's tests, due to directory being a symlink.
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[x] aarch64-darwin

Tested, as applicable:

[ ] NixOS test installer
[x] lib/tests/misc.nix

[x] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

Ofborg's lib tests can help here.

You want to run lib/tests/release.nix.

"Blocker" generally refers to things that are blocking major changes, not feature additions.


config: Allow alternative kubernetes.default.svc DNS names.

Summary

Sometimes scaffolding will fail due to minor differences in the local OIDC issuers, even though these are functionally the same.
2023-07-21T21:59:29.941Z        FATAL   app/serve.go:209        error loading --config-path=/etc/fulcio-config/config.json: provider https://kubernetes.default.svc: oidc: issuer did not match the issuer returned by provider, expected "https://kubernetes.default.svc" got "https://kubernetes.default.svc.cluster.local"

This adds support for https://kubernetes.default.svc.cluster.local, and will load the cluster CA to the transport if either are present.
Also removes the originalTransport global var, since it isn't being used in a meaningful way.
cc @vaikas
Release Note

Adds support for alternative local-kubernetes OIDC issuer DNS names (e.g.  kubernetes.default.svc vs  kubernetes.default.svc.cluster.local)
Documentation

Bump, is this still needed!

I actually don't know 😅
This was partially in response to some of the issues we've been seeing in scaffolding. I'll close this for now, we can always reopen 🤷


add reboot_required metric, PEP8ify

Add an updates.reboot_required metric, which'll let us indicate when boxes are in need of a reboot (because, say, they have a critical kernel update).
Also, fix a few PEP8-related things that my editor was angry about while I'm here.

@asf pointed me at the file checks we do for vulnerable-packages.running, but those aren't precisely what I'm after. This check is different: it looks to see if we are pending a reboot because of a security-related kernel update.

Sorry for leaving this open for a long time; I still think this should be a file check (and is, currently?). I'll close this for now, but feel free to re-open (:


Werid Characters after pasting code

Description of the problem or steps to reproduce
After pasting code into the buffer in any terminal ( conemu , powershell , cmd ) the endline characters can be seen .
Specifications

Commit hash:d0b75c
OS:Windows
Terminal:Powershell.

The referenced commit should fix this issue. In general, if you are using CRLF line endings (\r\n) rather than LF line endings (\n) I recommend setting the fileformat to dos rather than unix.


[Bug] Lspconfig fails to start randomly when this plugin is enabled

Hello
I started getting random weird issues occasionally where I dont get syntax highlight when I open some files due to 'nvim-lspconfig' not loading and until I execute ':e' on the buffer the lspconfig fails to load.
After disabling spelunk the problem magically stop occurring so this is what this issue is about.
There where no errors thrown and sadly I don't really have any useful info to provide.
My best guess its one of the recent commits from the last week since I do update regularly and this started occurring after updating my plugins last night
Let me know if you need anything in particular I can pull out that might help with debugging this one out

Hey @GeorgiChochev! I was recently able to reproduce your issue after some more changes, and when opening another Python project using pyright.
I've pushed a branch with a potential fix in this PR: https://github.com/EvWilson/spelunk.nvim/pull/43
This seems to resolve the problem for me. Could I get your help checking if it resolves it for you as well, before I merge it? If you're using lazy.nvim as your package manager, you should be able to try it out by adding this to your plugin spec:
branch = 'lsp-startup-issue'

Thanks so much for the issue report!

Going to go ahead and merge this, to live with it myself and see if it solves the issue long-term. Let me know if you keep seeing the issue after updating, but otherwise I'll likely try to close this issue by the end of the weekend.

Looks to be working, thanks for the patch up


migrate:rollback fails

After trying this on multiple machines, I cannot seem to rollback any of my latest changes in L4 (using the SQLlite DB driver in this instance) and the error message is consistently as follows:-
PHP Fatal error:  Class 'CreateSessionTable' not found in /Users/ballen/Desktop/mrccms/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php on line 301
PHP Stack trace:
PHP   1. {main}() /Users/ballen/Desktop/mrccms/artisan:0
PHP   2. Symfony\Component\Console\Application->run() /Users/ballen/Desktop/mrccms/artisan:59
PHP   3. Symfony\Component\Console\Application->doRun() /Users/ballen/Desktop/mrccms/vendor/symfony/console/Symfony/Component/Console/Application.php:117
PHP   4. Symfony\Component\Console\Application->doRunCommand() /Users/ballen/Desktop/mrccms/vendor/symfony/console/Symfony/Component/Console/Application.php:204
PHP   5. Illuminate\Console\Command->run() /Users/ballen/Desktop/mrccms/vendor/symfony/console/Symfony/Component/Console/Application.php:940
PHP   6. Symfony\Component\Console\Command\Command->run() /Users/ballen/Desktop/mrccms/vendor/laravel/framework/src/Illuminate/Console/Command.php:96
PHP   7. Illuminate\Console\Command->execute() /Users/ballen/Desktop/mrccms/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:240
PHP   8. Illuminate\Database\Console\Migrations\RollbackCommand->fire() /Users/ballen/Desktop/mrccms/vendor/laravel/framework/src/Illuminate/Console/Command.php:108
PHP   9. Illuminate\Database\Migrations\Migrator->rollback() /Users/ballen/Desktop/mrccms/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php:54
PHP  10. Illuminate\Database\Migrations\Migrator->runDown() /Users/ballen/Desktop/mrccms/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:174
PHP  11. Illuminate\Database\Migrations\Migrator->resolve() /Users/ballen/Desktop/mrccms/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:194
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Error: Class 'CreateSessionTable' not found in \/Users\/ballen\/Desktop\/mrccms\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Migrations\/Migrator.php line 301","file":"\/Users\/ballen\/Desktop\/mrccms\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Migrations\/Migrator.php","line":301}}```

It should be pretty simple to replicate (just try rolling back any DB change), as you can see I tried this by adding the default session's migration too.

@gnarlymedia I'm having the same problem. I had just pushed everything to GitHub from my development machine then pulled it to my server and run composer dump-autoload and when I run php artisan migrate:reset I get the message Class 'AddPictuneTable' not found.
Have you ever resolved this?

@Arcrammer check your class name again. It looks like you misspelled Pictune instead of Picture in migration name.

Actually that's not a misspelling. I have solved my problem, though. I don't understand how, but I basically did a migration, then a rollback, then a migration with the seeders, then another rollback and another rollback which of course said there was nothing to rollback. After that everything seemed to have been magically fixed. I don't know.

I feel certain the seeders couldn't have had anything to do with the problem, though.

Hi Arcrammer, no I don't think I ever solved this one, but glad you got your setup fixed now. Cheers

@gnarlymedia

Comment out contents of down() method
public function down() { // Schema::drop('chieftags'); }
Execute composer dump-autoload
Execute php artisan migrate:rollback
Uncomment down() method
Execute php artisan migrate

Hope this helps.

Hi @ostrovskis thanks for that, I appreciate it! If I run into this issue again, I'll be sure to give your suggestion a try.


security vulnerabilities detected in Fluentd v1.15.3 using Prisma tool

Dear team,
Below high severity vulnerabilities are detected in Fluentd v1.15.3 using Prisma tool
Please find below the vulnerability having high severity:
CVE-2023-29491
CVE-2022-29458
CVE-2021-43809
CVE-2023-28755
CVE-2023-28756
Please let us know the impact and possible fix for above vulnerabilities

Dear team,
Please look in to the issue.

Thanks for your report.

Below high severity vulnerabilities are detected in Fluentd v1.15.3 using Prisma tool

The latest is v1.16.2, please use it.

CVE-2023-29491
CVE-2022-29458

Fluentd doesn't use ncurses when running as a deamon.

CVE-2021-43809

Already answered at https://github.com/fluent/fluentd-kubernetes-daemonset/issues/1421#issuecomment-1491609356

CVE-2023-28755
CVE-2023-28756

Already fixed in v1.16 image.
BTW we are happy if you could not only present the results of the tool, but also check the validity of the contents as much as possible (for CVE-2021-43809, we already notice you that it's doesn't affected).

Thank you for the information


Scrollable mailbox

Inbox now supports scrolling.
Tested in desktop Firefox and Chrome.

It has been so long since I coded plain CSS that I actually wrote it in Codepen as SCSS and copied over the compiled blocks. How lazy! ;)
https://github.com/ChildrenOfUr/cou-issues/issues/1744

@dazulu: the reason it didn't inherit the styles is because all of the things in components are sandboxes, so their CSS doesn't apply to the rest of the page, and outside CSS can't affect these elements. It's sometimes helpful, but mostly annoying.


Add templates option in deploy-pipeline

Credentials should not be stored in abacus-config, they should be externalised. All credentials are now consumed from a single place (credentials file or exported environment variables).

Can you please squash your commits?

Commits are now squashed.

Coverage decreased (-5.5%) to 87.637% when pulling a6efdf9cdf7e5a78fc0fcdc476b06780c367e9c9 on astefanova:templates into 5bba8b47f20eeee8337539e657a945fe08de37ef on cloudfoundry-incubator:master.

Coverage decreased (-0.06%) to 93.038% when pulling a6efdf9cdf7e5a78fc0fcdc476b06780c367e9c9 on astefanova:templates into 5bba8b47f20eeee8337539e657a945fe08de37ef on cloudfoundry-incubator:master.

Hey,
Thanks for the contribution. The change makes the configuration of Abacus easier and more secure so I want to have it as part of the Concourse pipeline.
We need some tests for the replace-template tool introduced in this PR.

Coverage decreased (-0.06%) to 93.038% when pulling 43f58dc828bcde2e188168c90b9774e8ea0b62fd on astefanova:templates into 5bba8b47f20eeee8337539e657a945fe08de37ef on cloudfoundry-incubator:master.

Coverage decreased (-0.06%) to 93.038% when pulling 43f58dc828bcde2e188168c90b9774e8ea0b62fd on astefanova:templates into 5bba8b47f20eeee8337539e657a945fe08de37ef on cloudfoundry-incubator:master.

Tests are added with
https://github.com/cloudfoundry-incubator/cf-abacus/pull/433/commits/5e30a66b7af0d201e39f1efb183d841af43b3bb0

Coverage remained the same at 93.098% when pulling 5e30a66b7af0d201e39f1efb183d841af43b3bb0 on astefanova:templates into 5bba8b47f20eeee8337539e657a945fe08de37ef on cloudfoundry-incubator:master.

@astefanova
Thank yo!
@hsiliev
I haven't used concourse before. Did you get a chance to test this?

Tested the pipeline with credentials file.

Coverage decreased (-0.06%) to 93.038% when pulling 135ccc4c935428a294c9e793d809ddd84b9fcd79 on astefanova:templates into 5bba8b47f20eeee8337539e657a945fe08de37ef on cloudfoundry-incubator:master.


Create linters.yml

First commit to initialize installation of linters and node modules. Github workflow folder is created to make room for node modules to be install. This is to enable good Microverse workflow practices without errors. This changes is going to be repeated in other subsequent Projects in the future and incorporated in the working field.

Passed all standard linters protocol. Ready to move to the actual project.


How should I design my ListSectionController model if I want to return dynamic cells

Let's say I have a Post model. Post has image, title, comment properties. Comment property is optional. So, in my PostSectionController (section controller that manages post model), how many numberOfItems, cellForItem, sizeForItem do I return?  So if comment is an empty string, how should I model the code?

Hey @joseph-francis, check out our demos, we have something almost exactly like this. You can also check out IGListBindingSectionController which does a lot of the dynamic stuff for you. There’s a demo for that too!
Sent with GitHawk

Hey @joseph-francis did you manage to get it solved?

Yes I have. Thank you so much! I forgot to reply. Please also let Ryan
Nystrom know that I really appreciate his help.
Thank you,
JF
On Thu, Dec 7, 2017 at 2:24 AM, Sebastian Benzian Olsson <
<EMAIL_ADDRESS>wrote:

Hey @joseph-francis https://github.com/joseph-francis did you manage to
get it solved?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Instagram/IGListKit/issues/1001#issuecomment-349896396,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AXP3d8rCy5oSkyHSYZLYuDiMz3D0BDXQks5s96C_gaJpZM4QPFsS
.


Receiving two notifications when I integrated with FCM + Tap on notifee notification does not open up app

I have integrated FCM and showing notification using notifee by following below link.
https://notifee.app/react-native/docs/integrations/fcm

Now I am receiving 2 notifications so how to stop showing notification which I receive via FDM?
Also notifee notification does not open app when we tap on it? I have used launchActivity, it opens up app but notification area/layer/panel still remains open. What am I missing here?

Thanks.

Hi there! Can you produce an App.js that we can drop into an app skeleton that reproduces this, and show us the full JSON that you send as the FCM? Also, you've failed to mention the versions of the tools in use or any details about the runtime environment (android, ios? what version?) so I don't have any information to go on

@hiteshagja hi, would you be able to provide some more details?

@mikehardy  @helenaford thanks for you reply. I have dropped my idea using notifee for this project because of project requirement changes.
Anyways, it's great library and you guys doing great job.

@helenaford  @mikehardy  please reopen this issue.
I am always receiving two notification in background.
In foreground it working fine, I am facing this issue only in background background.
Index.js
import {AppRegistry, LogBox} from 'react-native';
import App, {navigationRef} from './App';
import {name as appName} from './app.json';
import "react-native-gesture-handler";
import messaging from '@react-native-firebase/messaging';
import notifee, {EventType, AndroidImportance, AndroidVisibility, AndroidLaunchActivityFlag} from '@notifee/react-native';

const handleBackgroundNotification = async (remoteMessage) => {
    console.log('Received background message:');

    const channelId = await notifee.createChannel({
      id: 'defaultchanel',
      name: 'Default Channel',
    });

      await notifee.displayNotification({
        title: 'Title',
        body: "Some message",
        android: {
          channelId,
          smallIcon: "ic_launcher",
          largeIcon: "ic_launcher",
          importance: AndroidImportance.HIGH,
          visibility: AndroidVisibility.SECRET,
          timestamp: Date.now(),
          pressAction:{
            id: "default",
            launchActivity: 'default',
            launchActivityFlags: [AndroidLaunchActivityFlag.LAUNCHED_FROM_HISTORY]
          }
        }
      });

    //console.log('Notification displayed with id:', notification.id);
};

notifee.onBackgroundEvent(async ({ type, detail }) => {
  console.log("Background notification click")
  const { notification, pressAction } = detail;

  if (type === EventType.PRESS) {
   // notification click
  }
});

messaging().setBackgroundMessageHandler(handleBackgroundNotification);
AppRegistry.registerComponent(appName, () => App);

Payload:

{
"collapseKey": "com.PackageNameHere",
"data": {"badge": "0", "color": "#rrggbb"},
"from": "748164770588",
"messageId": "0:1681131245532320%ce3169d7ce3169d7",
"notification": {
    "android": {},
    "body": "Test body",
    "title": "Test Title"
},
"sentTime":<PHONE_NUMBER>511, "ttl": 2419200
}

Firebase display a notification with default configuration.
Can i disable/handle firebase to show this notification?

You are sending Fcm with a notification block, which always displays a notification. This comes from the underlying firebase sdks.
And your handler posts a notification in the background.
Choose one or the other or you will get two notifications
The issue should remain closed.

@mikehardy thanks for your reply,
Can you please explain it further to me, why it works fine in foreground with exactly the same payload and handle function
App.js
useEffect (() => {
    const unsubscribe = messaging().onMessage(onNotifeeMessageReceived);
    return unsubscribe;
  },[])

  const onNotifeeMessageReceived = (notification) => {
    console.log("Foreground message receive: ", notification)
   const channelId = await notifee.createChannel({
            id: 'worktuallyDefault',
            name: 'Default Channel',
        });

            await notifee.displayNotification({
                title: "any",
                body: "any,
                android: {
                    channelId,
                    smallIcon: "ic_launcher",
                    largeIcon: "ic_launcher",
                    importance: AndroidImportance.HIGH,
                    visibility: AndroidVisibility.SECRET,
                    showTimestamp: true,
                    timestamp: Date.now(),
                    pressAction:{
                        id: "default",
                        launchActivity: 'default',
                        launchActivityFlags: [AndroidLaunchActivityFlag.SINGLE_TOP]
                    }
                }
            });
  }

Do i need to remove the notification object from the backend or which handler i need to remove, i want to stop firebase sdk to show that notification.

The underlying firebase SDK does not show a notification for foreground messages. So in that case the only notifications you will see are from your handlers.

@mikehardy
What will be the proper solution for background.
if i remove the notifee.display() from background handler then notifee.onBackgroundEvent() will not receive any event.
Do i need to create separate issue for this, I am unable to get it working properly for background.
Can you provide an example to get it working for background.

notifee is just for handling foreground notification and foreground events.
In background kill state the firebase sdk default notification is generated only, so the notifee.onBackgroundEvent() is also useless in that case.


WIP: handle large chunks that get split by http lib

Closes #44 by looking for HTTP chunk delimiters in the HTTP stream coming back from Ollama.
WIP because it needs a bit more testing.
Here's an example of a stream captured with tcpdump:
HTTP/1.1 200 OK
Content-Type: application/x-ndjson
Date: Wed, 24 Jan 2024 17:14:00 GMT
Connection: close
Transfer-Encoding: chunked

69
{"model":"codellama:13b-code","created_at":"2024-01-24T17:14:00.708054246Z","response":"(","done":false}

6e
{"model":"codellama:13b-code","created_at":"2024-01-24T17:14:00.719238491Z","response":"module","done":false}

69
{"model":"codellama:13b-code","created_at":"2024-01-24T17:14:00.730212903Z","response":".","done":false}

The server is sending two newlines at the end of each chunk. This PR updates streamResponse to concatenate all the data it receives from the HTTP stream until it gets a piece of data ending with \n, then it send all the data (the whole HTTP chunk) to the caller.
Tested with HTTP chunks that did get split coming back from the server as well as normal chunks.

@rjmacarthy

Thanks for the PR see comment https://github.com/rjmacarthy/twinny/issues/44#issuecomment-1908784692 which includes a fix similar already to this.  I did try to notify you before you submitted, thanks.

Thanks for the PR see comment #44 (comment) which includes a fix similar already to this. I did try to notify you before you submitted, thanks.

Yeah, np, I just got into it and didn't see your message until after.

Reopening as may be better solution


How to use a etcd with cert authentication as the backend store with api-server

I enabled cert based authentication for the etcd generated by the tool like this
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: etcd
namespace: mir-apiserver-system
spec:
replicas: 1
serviceName: etcd
template:
metadata:
labels:
app: etcd
spec:
containers:
- command:
- /usr/local/bin/etcd
- --listen-client-urls
- http://<IP_ADDRESS>:2379
- --advertise-client-urls
- http://localhost:2379
- --cert-file=/apiserver.local.config/certificates/tls.crt
- --key-file=/apiserver.local.config/certificates/tls.key
- --client-cert-auth=true
env:
- name: ETCD_DATA_DIR
value: /etcd-data-dir
image: quay.io/coreos/etcd:latest
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /health
port: 2379
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
name: etcd
ports:
- containerPort: 2379
readinessProbe:
failureThreshold: 1
httpGet:
path: /health
port: 2379
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
resources:
limits:
cpu: 100m
memory: 30Mi
requests:
cpu: 100m
memory: 20Mi
volumeMounts:
- mountPath: /etcd-data-dir
name: etcd-data-dir
- mountPath: /apiserver.local.config/certificates
name: apiserver-certs
readOnly: true
terminationGracePeriodSeconds: 10
volumes:
- name: apiserver-certs
secret:
secretName: raushankapiserver
volumeClaimTemplates:

metadata:
name: etcd-data-dir
spec:
accessModes:

ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: managed-premium

After port forwarding, I can now use etcdctl etcdctl --cert-file /home/raushank/go/src/sample-api-server/config/certificates/apiserver.crt --key-file /home/raushank/go/src/sample-api-server/config/certificates/apiserver.key put foo bar
Now how can i make it work with the api-server which takes
- --etcd-servers=http://etcd-svc:2379
- --tls-cert-file=/apiserver.local.config/certificates/tls.crt
- --tls-private-key-file=/apiserver.local.config/certificates/tls.key
- --audit-log-path=-
- --audit-log-maxage=0
- --audit-log-maxbackup=0

      --etcd-cafile string                                      SSL Certificate Authority file used to secure etcd communication.
      --etcd-certfile string                                    SSL certification file used to secure etcd communication.
      --etcd-keyfile string

you can use these flags to set up SSL connection w/ ur etcd backends.. and your etcd endpoints are required to be https endpoints

Can you point me if there are documentation about what all options are supported by the api-server like --etcd-servers ....

https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/
for aggregated apiserver, most of flags are inherited from kube-apiserver

Thanks for the pointer.
Correct me if i am wrong, In my scenario i don't need to pass cafile if etcdctl works without that
etcdctl --cert=/home/raushank/go/src/sample-api-server/config/certificates/apiserver.crt --key=/home/raushank/go/src/sample-api-server/config/certificates/apiserver.key --endpoints=https://raushank-etcd1.etcd.foobar.com:2379 put foo bar

not really sure about that.. but conventionally, we have to set cafile if cert/keyfile is present

Thanks it worked.


Unable to create local user for Windows Server 2016

I'm trying to create a simple local user for Windows Server 2016, but it fails with the following error message:
Invoke-CimMethod : PowerShell DSC resource MSFT_UserResource  failed to execute Set-TargetResource functionality with error
message: There could be a possible multiple matches exception while trying to use the System.DirectoryServices
API's.Exception calling "Save" with "0" argument(s): "The password does not meet the password policy requirements. Check
the minimum password length, password complexity and password history requirements.
"
At C:\DSC\Data\Utilities\Invoke-DscPull.ps1:64 char:9
+         Invoke-CimMethod @Parameters @PSBoundParameters
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Invoke-CimMethod], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure,Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMet
   hodCommand
    + PSComputerName        : mynode

Invoke-CimMethod : One or more partial configurations failed to apply. No configuration could be created.
At C:\DSC\Data\Utilities\Invoke-DscPull.ps1:64 char:9
+         Invoke-CimMethod @Parameters @PSBoundParameters
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (root/microsoft/...gurationManager:String) [Invoke-CimMethod], CimException
    + FullyQualifiedErrorId : MI RESULT 6,Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMethodCommand
    + PSComputerName        : mynode

I was able to create a user with this exact configuration on a Windows Server 2012 R2 node just fine, so this leads me to believe there's some sort of difference in how the different versions of the operating system work, but I could very easily be wrong (DSC is still enigmatic to me).
The relevant part of the script that generates the MOF file, which spits out no errors during creation, is the following:
Configuration LocalUserConfiguration {
    Import-DscResource -ModuleName PSDesiredStateConfiguration, xPSDesiredStateConfiguration

    Node $AllNodes.NodeName {
        $UserName = "mylocaluser"
        User LocalUser {
            Ensure                   = "Present"
            Disabled                 = $False
            UserName                 = $UserName
            Password                 = (Get-Credential -UserName $UserName -Message "Enter configuration user credentials")
            PasswordChangeNotAllowed = $True
            PasswordChangeRequired   = $False
            PasswordNeverExpires     = $True
        }
    }
}

The node registered with the pull server successfully and is able to configure itself according to other MOF files just fine. I am using the OleDb provider for my pull server and my pull server is running Windows Server 2012 R2. Here are the relevant bits for the pull server:
> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
6      3      9600   0

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.0.10586.117
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.10586.117
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           <IP_ADDRESS>

Here are the relevant bits for the node:
> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      14393  0

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.0
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.0
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           <IP_ADDRESS>

The MOF file for the account configuration has an encrypted password, the node has the necessary certificate to decrypt, the password does meet the minimum local requirements if they are the following:
Local Computer Policy -> Computer Configuration -> Windows Settings ->
Security Settings -> Account Policies -> Password Policy

Enforce password history: 2 passwords remembered
Maximum password age: 70 days
Minimum password age: 0 days
Minimum password length: 8 characters
Password must meet complexity requirements: Enabled
Store passwords using reversible encryption: Disabled

as it is over 8 characters long, includes upper- and lower-case letters, numbers, and non-alphanumeric characters.
I saw that in issue #194 @DamianBis got the exact same error message, but in a different scenario, so maybe the password complexity message is irrelevant to what's actually going on.
Any help is appreciated!

Update:
I've created a test pull server that matches the Windows Server 2016 node, and I am still getting the initial error about password complexity. To re-iterate, this was not an issue on a 2012 node.

Update 4:
Having debugged this further I found out that during the Set-TargetResource execution, the DSC engine sees the password length as several hundred characters for the Credential object instead of the 15 or so that I am using. This leads me to believe that something has changed in the way credentials are decrypted on Windows Server 2016. The exact same setup for configurations and certificates works on Windows Server 2012 R2 nodes. Any help is still very much appreciated!

@usrme
Can you try using 'xUser' rather than 'User'?
This will use the User resource from this repo (much more updated) rather than the in-box version from PSDesiredStateConfiguration.
If the problem still persists, I will ask the PowerShell experts here what's going on with the credential object length.

@kwirkykat, I updated my xPSDesiredStateConfiguration module from <IP_ADDRESS> to <IP_ADDRESS>, re-deployed the module, switched the User resource to xUser, and I am still getting the same error with the only difference being that this time the xUser resource fails instead of User. The exact same configuration succeeded for Windows Server 2012 R2 nodes.

Update 5:
Switched to Chef for configuration management with DSC and the user was created successfully. Here's what I used:
dsc_resource 'my-user' do
	resource :user
	property :ensure, 'Present'
	property :username, user['username']
	property :password, ps_credential(user['password'])
	property :passwordchangenotallowed, $true
	property :passwordchangerequired, $false
	property :passwordneverexpires, $true
end

@usrme Glad you found a workaround 👍 It looks like the DSC pull server may actually be throwing the error. I'll let the team know about it

Hi, I've just encountered this bug (WMF 5.1 on Windows Server 2012R2)
It looks like a partial configurations and credentials encryption bug in WMF (also mentioned here )
If any one partial configuration doesn't have any resources using credentials, credentials in other partial configuration MOF files don't get decrypted.
I use xUser resource in one of my partial configurations and that one is currently the only resource using credentials. When I publish only that partial configuration, it works as expected. I've also added a Write-Verbose to Set-TargetResource to check the password string - it's the correct password.
When the configuration is published with other partial configurations, that Write-Verbose spits out still encrypted string:
-----BEGIN CMS-----
MIICsQYJKoZIhvcNAQcDoIICojCCAp4CAQAxggJZMIICVQIBADA9MCkxJzAlBgNVBAMMHmhxLWhv
...
0pURHTUN3++y
-----END CMS-----

It looks like the only workaround at the moment is to have a custom dummy DSC resource that uses a credential parameter and add it to all your partial configurations with a dummy credential...

Yup, I've just confirmed it. We have 8 partial configurations for configuring our hosted servers. One of those handles Windows users.
Unless I add a dummy User resource to every partial configuration (with a dummy password and Ensure set to "Absent"), passwords for real Windows users are not getting decrypted (we're using xUser for "proper" Windows user resources)

I see this is closed as external but I can't seem to find a solution.  It's strange to me that the DSC resource user and xUser have been broken for this long.  What is the work around?

@embusalacchi It's an issue when using partial configurations, not an issue with the resources. See the last two comments from @bozho for the workaround.

@embusalacchi It's an issue when using partial configurations, not an issue with the resources. See the last two comments from @bozho for the workaround.

Ahh, yes.  I spent more time with what he had to say this morning and I'm working now.  Thank you @johlju


failed to create host: Image windows-server-2019 is not compatible with resource class l1.medium

I ran into this error when trying the default options in the config.yml:
version: 2.1

orbs:
  windows-tools<EMAIL_ADDRESS>
jobs:
  build:
    executor:
      name: windows-tools/preview-default
      shell: bash.exe
    steps:
      - checkout
      - run: ls -lah
      - run:
          command: ping circleci.com
          shell: cmd.exe
      - run:
          command: echo 'This is powershell'
          shell: powershell.exe

Build-agent version 1.0.12069-0bafdb01 (2019-07-05T21:14:34+0000)
Creating a dedicated VM with windows-server-2019 image
failed to create host: Image windows-server-2019 is not compatible with resource class l1.medium

failed to create host: Image windows-server-2019 is not compatible with resource class l1.medium

Do you have any insight on what I could do to make it work out ?

Do you have a link to the project?
 Your org should now have Windows access. A feature flag was set incorrectly on our side. Please let me know if this fixes it.

@appplemac Thanks a lot ! everything is now running smoothly.


Update api-management-advanced-policies.md

response-variable-name="existing response variable" is unnecessary.

adding @Juliako for visibility

#sign-off


Mattermost moving to API version 4

Hey @fguillot !
First, hugely appreciate you sharing this project back with the world. Fantastic work!
I wanted to let you know about our plans moving to API v4:
To make the Mattermost API web service easier to use and to offer more powerful options for these integrations, Mattermost will be moving to a new API version soon.  Highlights include:

Fully documented API endpoints
More in-depth access to server functionality
Wider use of established HTTP verbs
Consistent endpoint structures
A new and improved Go driver

We plan to release API version 4 on March 16th, with Mattermost server 3.7.  While the current API version 3 will be supported until September 16th, we recommend you begin using API version 4 soon after its release.
Contributing
API version 4 is an active and on-going project. If you're interested in helping contribute, please join our Mattermost community instance and the APIv4 channel.
We've prepared a contribution process for APIv4 and a progress tracker for new APIv4 enpoints to help you get started.
We're also open for suggestions on adding new API endpoints to help with your integration.

This issue has been closed automatically for inactivity after more than 1 year. Unfortunately, this project doesn't have enough resources to manage all these requests. Read the FAQ.


nodePackages.esy: init at 0.6.7

Motivation for this change
Adding the esy package is one step towards integrating the esy package manager with Nix.
Things done

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[x] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

Tested by building with Node.

I'm not sure where the util-linux -> utillinux change came from; I can revert that as necessary if it's not part of the process. I just followed the documentation for adding an NPM package to nixpkgs.

I'm not sure where the util-linux -> utillinux change came from; I can revert that as necessary if it's not part of the process. I just followed the documentation for adding an NPM package to nixpkgs.

I'm not sure where the util-linux -> utillinux change came from; I can revert that as necessary if it's not part of the process. I just followed the documentation for adding an NPM package to nixpkgs.

it comes from node2nix. Maybe we need to bump it in nixpkgs to fix https://github.com/svanderburg/node2nix/issues/213.

I'm not sure where the util-linux -> utillinux change came from; I can revert that as necessary if it's not part of the process. I just followed the documentation for adding an NPM package to nixpkgs.

it comes from node2nix. Maybe we need to bump it in nixpkgs to fix https://github.com/svanderburg/node2nix/issues/213.

I'm not sure where the util-linux -> utillinux change came from; I can revert that as necessary if it's not part of the process. I just followed the documentation for adding an NPM package to nixpkgs.

it comes from node2nix. Maybe we need to bump it in nixpkgs to fix svanderburg/node2nix#213. Please revert it. Also I am probably going to take your PR and merge it with two other nodePackages updates.

Done! That sounds great, feel free to do so.

I'm not sure where the util-linux -> utillinux change came from; I can revert that as necessary if it's not part of the process. I just followed the documentation for adding an NPM package to nixpkgs.

it comes from node2nix. Maybe we need to bump it in nixpkgs to fix svanderburg/node2nix#213. Please revert it. Also I am probably going to take your PR and merge it with two other nodePackages updates.

Done! That sounds great, feel free to do so.

PR got combined with a few others other node updates. Closing so that the update goes trough smoothly.

PR got combined with a few others other node updates. Closing so that the update goes trough smoothly.


[IoTDB-1913] When exporting a amount of data, it will report network error or OOM

Coverage increased (+0.01%) to 67.068% when pulling 2eae0417f2b51529b687fd2227fa13484ca2ecbb on xuanronaldo:fix_1913 into 0073a28384cdb84e9469dbf98705ab158dd43a31 on apache:master.


Pipeline enrichment 2016

I think the geneinfo and enrichment pipelines are just about usable now :)

Great, many thanks!


Regions

This pull request allows the user to specify an included or excluded region to determine if a pull request should or should not build.

To specify with dsl plugin I used the follow:
triggers {
      	configure { node ->
           	node / 'triggers' << 'org.jenkinsci.plugins.ghprb.GhprbTrigger' {
            	        includedRegion('e-commerce/.*')
              	        orgslist('ithaka')
        	        triggerPhrase('build')
        	        useGitHubHooks(true)
        		allowMembersOfWhitelistedOrgsAsAdmin(true)
              	        'extensions' {
                               'org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus' {
                  	             commitStatusContext("\${JOB_NAME}")
                               }
                        }
          	}
        }
    }

Could you please extract this from the main plugin configuration and make it an extension instead?  Follow the other extension options .ghprb.extensions.

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@DavidTanner thanks for the quick reply. I'll take a look at doing that when I get some free time. Closing this pull request until that time.


bedToBigBed allow1bpOverlap

Is there an equivalent to the bedToBigBed option -allow1bpOverlap in bigtools bedtobigbed?
   -allow1bpOverlap  -- allow exons to overlap by at most one base pair

Or is the behavior allowed automatically without needing to set an option?
Cheers,
Mitchell

My understanding here is that this flag only changes some validation checks that the ucsc bedToBigBed does that bigtools doesn't do. So, it doesn't actually affect the final file.


CSLA-24: Re-enable Appveyor cache.

DO NOT MERGE
This is not a fix for CSLA-24, but rather an attempt to reproduce the problems
with the latest code.

@jmitchell best to comment out node stuff for now.


Cold Start

When the app is in the background and I open a deeplink, it brings the app up and goes to the page requested.
this.platform.ready().then(() => {
      this.statusBar.overlaysWebView(false);
      this.statusBar.backgroundColorByHexString('#222');

      this.splashScreen.hide();

      this.setRootPage();
      handleBranch();
    });

this.platform.resume.subscribe(() => {
      handleBranch();
    });

const handleBranch = () => {
      // only on devices
      if (!this.platform.is('cordova')) { return }
      const Branch = window['Branch'];
      Branch.initSession(data => {
        if (data['+clicked_branch_link']) {
          // read deep link data on click
          //alert('Deep Link Data: ' + JSON.stringify(data));
          this.nav.push(data['page'],{itemId:data['id']});
        }
      });
    }

However, if i force quit the app, and then click on a deeplink, it opens the app and stays on the root page.
Any ideas?

did you try to look at the outputs given with Branch.setDebug(true) before your initSession code?

There seems to be no errors.
When i put the line below, i actually get the alert just fine.
alert('Deep Link Data: ' + JSON.stringify(data));
So i presume the following code doesnt execute in the order set. How do i wait for the top before running the second? confused
this.setRootPage();
handleBranch()

Just tried to test it on an android device, and works fine - even on a cold start.
So the issue remains just for ios.

Okay, in case anyone faces the same issue. Just delay branch in this.platform.ready. I have delayed it by a second - since everything is async, I do not think it will have an impact. I have tested it and it works fine.
handleBranch();

Hello,
Good find and good solution. It appears this.setRootPage(); is an Ionic method which creates a new instance of the page. This method must have some funky behavior interally which creates a race condition with the Branch initialization.
Another solution besides timeouts would be to place the handleBranch() within the done parameter of setRoot() (docs). However, this depends on which version of the Ionic SDK you are using.
Thanks,


Add OpenCC Alfred 2 workflow

This is a Mac app Alfred 2 workflow use by OpenCC, I hope you can agree to merge, thank so much. :smile:

Thanks


Add AppSync trust policy to generated IAM roles if API category exists in Amplify app

I have not verified this is still a problem in the latest version of the CLI.
We were having a problem querying for relationships against a base User model with AppSync. After further investigation, the Amplify-generated authenticated role contained the following trust policy:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Federated": "cognito-identity.amazonaws.com"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "ForAnyValue:StringLike": {
          "cognito-identity.amazonaws.com:amr": "authenticated"
        }
      }
    }
  ]
}

I believe that AppSync requires a trust policy,  per AppSync documentation:

AWS AppSync communicates with data sources using Identity and Access Management (IAM) roles and access policies. If you are using an existing role, a Trust Policy needs to be added in order for AWS AppSync to assume the role. (https://docs.aws.amazon.com/appsync/latest/devguide/security.html)

Once I updated the CLI-generated policy to this, relationships started working:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Federated": "cognito-identity.amazonaws.com"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "ForAnyValue:StringLike": {
          "cognito-identity.amazonaws.com:amr": "authenticated"
        }
      }
    },
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "appsync.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

Is your feature request related to a problem? Please describe.
Please consider adding this Trust Policy to the CLI generated trust policy for the role, if the API category is configured for that application.

@jkeys-ecg-nmsu AppSync creates its own role as a part of the transformer and associates this policy to it. Why would we need to add this policy to our Auth role?

I was confused as to which policy AppSync was using. So why did we go from getting empty items lists to getting items back from Dynamo without any other changes? A mystery for another time I suppose. Thanks.


Support Sentry notification

It would be great if Digdag can send an error notification via Sentry.

@komamitsu What topic do you think as the benefits compared with slack notification with HTTP?
I think there are good point to have such feature in Sentry. Anything else?

summarizable
categorizable with tag
customize notification

but it may contain secrets in error. that is off-topic though.

Close the old issue. Please reopen or file new one if you need.


TICtxtWrd-common: Test Improvement, Context Wording, for ecosystem common.

Test Improvement, Context Wording, for ecosystem common.
Writing a sensible context, for test.

Looks like some merge conflicts in this PR, I see a bunch of unrelated commits etc, could you clean that up please?

https://github.com/dependabot/dependabot-core/pull/9856 is deployed and merged


/biome command is broken

This error appears in the console:
[16:50:13] LUA: Plugins/Essentials/general.lua:5: attempt to concatenate global 'biome' (a nil value)
[16:50:13] Stack trace:
[16:50:13]   Plugins/Essentials/general.lua(5): (no name)
[16:50:13] Stack trace end
[16:50:13] Error in plugin Essentials calling function ()

The issue seems to be fixed.

closing then.
No idea about the cause


SIP OPTIONS support

Implement SIP OPTIONS support as done in this JsSIP PR

@avanlent The code looks fine, but one CI fails, can you try to run flutter format lib/ test/ to fix it?


Upgrade splunk/fluentd-hec image to address CVEs

<
What would you like to be added:
The current version(1.2.5) of the fluentd-hec image defaulted with the chart contains few CRITICAL and many HIGH severity CVEs. Moving to 1.2.7 addresses few of them, but still has many HIGH severity CVEs. There are fixes available to almost all of these dependencies, but I cant find a Dockerfile that is used to build these images. So please let me know how to make a pull request against the Dockerfile that is used to build this image.
Why is this needed:
Running containers with these high severity CVEs is not recommended and is not approved in many security conscious organizations.

@splunk-oss-admin  I looked at this repo : https://github.com/splunk/docker-fluentd-hec. However, it looks like it is 3 years old. Is there a different repo that is used to maintain this image ?

@luckyj5  What specifically should I be looking for there ? I did pull down the Dockerfile from 1.2.7, however it still has Critical CVEs present in one of the Ruby gems. My knowledge of Ruby is limited to provide a MR to fix this.


missing final line in parser error report

From @bob-carpenter on July 20, 2017 19:35
Summary:
With program
data {
  foo bar; } model { }

CmdStan outputs:
SYNTAX ERROR, MESSAGE(S) FROM PARSER:

  error in '/Users/carp/temp2/foo.stan' at line 2, column 3
  -------------------------------------------------
     1: data {
     2:   foo bar; } model { }
          ^
  -------------------------------------------------

PARSER EXPECTED: <one of the following:
  a variable declaration, beginning with type,
      (int, real, vector, row_vector, matrix, unit_vector,
       simplex, ordered, positive_ordered,
       corr_matrix, cov_matrix,
       cholesky_corr, cholesky_cov
  or '}' to close variable declarations>

whereas RStan (on my Mac, RStudio and R GUI), I get:
SYNTAX ERROR, MESSAGE(S) FROM PARSER:

  error in 'model10239103581_foo' at line 2, column 3
  -------------------------------------------------
     1: data {
          ^
  -------------------------------------------------

PARSER EXPECTED: <one of the following:
  a variable declaration, beginning with type,
      (int, real, vector, row_vector, matrix, unit_vector,
       simplex, ordered, positive_ordered,
       corr_matrix, cov_matrix,
       cholesky_corr, cholesky_cov
  or '}' to close variable declarations>

What's odd is that it's only partway through the output from the parser.
RStan Version:
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X Yosemite 10.10.5

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rstan_2.16.2         StanHeaders_2.16.0-1 ggplot2_2.2.1

loaded via a namespace (and not attached):
 [1] colorspace_1.3-2 scales_0.4.1     assertthat_0.1   lazyeval_0.2.0   plyr_1.8.4       tools_3.3.2
 [7] inline_0.3.14    gtable_0.2.0     tibble_1.2       gridExtra_2.2.1  Rcpp_0.12.8      grid_3.3.2
[13] stats4_3.3.2     munsell_0.4.3

Copied from original issue: stan-dev/rstan#436

From @bob-carpenter on July 20, 2017 20:3
Not that I know of.  If you could take a look, that'd be great.

From @sakrejda on July 20, 2017 19:46
Did you guys figure out where this came from? Mostly nosy but I did look at the associate Rcpp code and could figure this out.

From @bob-carpenter on July 20, 2017 21:53
I tried that magic to install from GitHub and it spit out a lot of lines about git and then did the same thing---missing a line.
And yes, @sakrejda, there should be a << std::endl after diagnostics --- it will automatically flush that way.  I'd have thought the message and everything else would do the right thing with the string stream, but apparently not.

From @sakrejda on July 20, 2017 20:5
It doesn't reproduce in R 2.15.2 on my Mac but I'll update and see if it does then.

From @sakrejda on July 20, 2017 21:35
Seems like also happens with source install, I'm suspicious that a stream
isn't getting flushed on line 71 or so of parser.hpp but I haven't
reinstalled yet to check. Either way it's odd.
On Thu, Jul 20, 2017, 4:56 PM bgoodri<EMAIL_ADDRESS>wrote:

And to clarify, this is only with the CRAN binary rstan or is it also with
a source install, e.g. devtools::install_github("stan-dev/rstan", ref = "v2.16.2", subdir = "rstan/rstan")?
On Thu, Jul 20, 2017 at 4:05 PM, Krzysztof Sakrejda <
<EMAIL_ADDRESS>wrote:

It doesn't reproduce in R 2.15.2 on my Mac but I'll update and see if it
does then.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/stan-dev/rstan/issues/436#issuecomment-316814972,
or mute
the thread
<
https://github.com/notifications/unsubscribe-auth/ADOrqiKMr3RyPmjVzAVMth-_P4X2VvCHks5sP7MegaJpZM4OekqE
.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/stan-dev/rstan/issues/436#issuecomment-316827617, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAfA6WOIsyMvZsXHBnkKrx2V6Zqit8JLks5sP78VgaJpZM4OekqE
.

From @bgoodri on July 20, 2017 20:56
And to clarify, this is only with the CRAN binary rstan or is it also with
a source install, e.g. devtools::install_github("stan-dev/rstan", ref = "v2.16.2", subdir = "rstan/rstan")?
On Thu, Jul 20, 2017 at 4:05 PM, Krzysztof Sakrejda <
<EMAIL_ADDRESS>wrote:

It doesn't reproduce in R 2.15.2 on my Mac but I'll update and see if it
does then.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/stan-dev/rstan/issues/436#issuecomment-316814972, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADOrqiKMr3RyPmjVzAVMth-_P4X2VvCHks5sP7MegaJpZM4OekqE
.

ok, I guess now stanc requires an '\n' at the end of line.  Currently stanc function in rstan removes the last \n when reading code from a file and I guess this is how it behaves since the first version of rstan.   The bug can be sort of replicated with cmdstan if there is no \n at the end of the stan file.
$ od -c test.stan
0000000    d   a   t   a       {      \n               f   o   o       b
0000020    a   r   ;       }       m   o   d   e   l       {   }
0000037
mmac2:cmdstan-2.16.0 jq$ ./bin/stanc test.stan
Model name=test_model
Input file=test.stan
Output file=test_model.cpp

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

  error in 'test.stan' at line 2, column 4
  -------------------------------------------------
     1: data {
           ^
  -------------------------------------------------

PARSER EXPECTED: <one of the following:
  a variable declaration, beginning with type,
      (int, real, vector, row_vector, matrix, unit_vector,
       simplex, ordered, positive_ordered,
       corr_matrix, cov_matrix,
       cholesky_corr, cholesky_cov
  or '}' to close variable declarations>

I will take a look.
On Thu, Jul 20, 2017 at 5:54 PM Bob Carpenter<EMAIL_ADDRESS>wrote:

Or maybe it's a problem with string scope in exceptions? This also looks
suspicious on line 90:
throw std::invalid_argument(msg.str());
I think we should be setting that to a local std::string (which copies),
then call that. Even though it seems like that's also going to go out of
scope, I seem to remember having problems with something like this before.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/stan-dev/rstan/issues/436#issuecomment-316841075, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAELlOktLC8GrNq3TT26h3vr9F2EkOFBks5sP8yngaJpZM4OekqE
.

From @bob-carpenter on July 20, 2017 21:54
Or maybe it's a problem with string scope in exceptions?  This also looks suspicious on line 90:
throw std::invalid_argument(msg.str());

I think we should be setting that to a local std::string (which copies), then call that.  Even though it seems like that's also going to go out of scope, I seem to remember having problems with something like this before.

It's weird.    So I am thinking the issue lies in something other than wrongly processing the error message.
$ R -q -e "library(rstan); stanc('test.stan')"
> library(rstan); stanc('test.stan')
Loading required package: ggplot2
Loading required package: StanHeaders
rstan (Version 2.16.3, packaged: 2017-07-21 02:04:11 UTC, GitRev: 901101506c4f)
For execution on a local, multicore CPU with excess RAM we recommend calling
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
Warning message:
package ‘StanHeaders’ was built under R version 3.4.1

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

  error in 'model14a1521ca7bda_test' at line 2, column 3
  -------------------------------------------------
     1: data {
     2:   foo bar; } model { }
          ^
  -------------------------------------------------

PARSER EXPECTED: <one of the following:
  a variable declaration, beginning with type,
      (int, real, vector, row_vector, matrix, unit_vector,
       simplex, ordered, positive_ordered,
       corr_matrix, cov_matrix,
       cholesky_corr, cholesky_cov
  or '}' to close variable declarations>
Error in stanc("test.stan") :
  failed to parse Stan model 'test' due to the above error.
Execution halted

From @sakrejda on July 21, 2017 15:0
We might just want to decide what it is that stanc is supposed to take (text file or just string) and be consistent about this.  It's silly to be adding/deleting newlines.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_403
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206

From @bob-carpenter on July 21, 2017 16:3
stanc shouldn't care if there's a final newline.  As far as I can tell, it's OK and CmdStan is OK on the output, even with a single line.
It's generally good practice to have a newline at the end, but it shouldn't disrupt any of our output or prevent having error messages for the last line.
If there's something not handling this correctly in stan-dev/stan, it should be fixed there.

@bob-carpenter I can reproduce this in cmdstan.  I am pasting what I posted last time again below.  (It might not be easy to create a text file without EOL at the end as some text editor such as Vim will add one automatically.)
$ od -c test.stan
0000000    d   a   t   a       {      \n               f   o   o       b
0000020    a   r   ;       }       m   o   d   e   l       {   }
0000037
mmac2:cmdstan-2.16.0 jq$ ./bin/stanc test.stan
Model name=test_model
Input file=test.stan
Output file=test_model.cpp

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

  error in 'test.stan' at line 2, column 4
  -------------------------------------------------
     1: data {
           ^
  -------------------------------------------------

PARSER EXPECTED: <one of the following:
  a variable declaration, beginning with type,
      (int, real, vector, row_vector, matrix, unit_vector,
       simplex, ordered, positive_ordered,
       corr_matrix, cov_matrix,
       cholesky_corr, cholesky_cov
  or '}' to close variable declarations>

In addition, I am reporting a case for which stanc does not provide any error message.
$ od -c test2.stan
0000000    d   a   t   a       {  \n
0000007
mmac2:cmdstan-2.16.0 jq$ ./bin/stanc  test2.stan
Model name=test2_model
Input file=test2.stan
Output file=test2_model.cpp

PROGRAM ERROR, MESSAGE(S) FROM PARSER:

(I only have data { \n in my test2.stan.)

D'oh---I should've just used echo in the terminal.  Thanks for moving the issue.  I think the issue may be with the flush as @sakrejda pointed out earlier.  I'll check it out.

I was doing a little debug-by-print and even the 'diagnostics' variable is incomplete.

@sakrejda  What do you mean by incomplete?  It's not all coming back from the semantic actions, etc.?   And I assume you mean the variable defined at line 62 of parser.hpp?

This line:
        std::string diagnostics = prog_grammar.error_msgs_.str();

is producing a truncated error message in diagnostics.  If I print it directly right after this line it comes out truncated (using std::cout).  std::cout is supposed to print std::string without conversion so I think the problem is deeper that that (within prog_grammar.error_msgs_.str()).  I didn' thave a chance to look in there yet.
Here's the edited snippet:
      try {
        parse_succeeded = phrase_parse(fwd_begin, fwd_end, prog_grammar,
                                       whitesp_grammar, prog);
        std::string diagnostics = prog_grammar.error_msgs_.str();
          std::cout << "++++++++++++++++++++++++__" << std::endl;
          std::cout << diagnostics << std::endl;
          std::cout << "++++++++++++++++++++++++__" << std::endl;
        if (out && is_nonempty(diagnostics))
          *out << "DIAGNOSTIC(S) FROM PARSER:" << std::endl
               << diagnostics << std::endl;
      } catch (const expectation_failure<lp_iterator>& e) {
        std::stringstream msg;
        std::string diagnostics = prog_grammar.error_msgs_.str();
        if (out && is_nonempty(diagnostics))
          msg << "XXX SYNTAX ERROR, MESSAGE(S) FROM PARSER:" << std::endl
              << std::endl << diagnostics << std::endl;
          std::cout << "__________________________" << std::endl;
          std::cout << diagnostics << std::endl;
          std::cout << "__________________________" << std::endl;
        if (out) {
          std::stringstream ss;
          ss << e.what_;
          std::string e_what = ss.str();
          std::string angle_eps("<eps>");
          if (e_what != angle_eps)
            msg << "PARSER EXPECTED: "
                << e.what_
                << std::endl;
        }

Here's what gets printed:
SPH-KSakrejdaL:cmdstan krzysztof$ ./bin/stanc test.stan
Model name=test_model
Input file=test.stan
Output file=test_model.cpp
__________________________
  error in 'test.stan' at line 2, column 3
  -------------------------------------------------
     1: data {
          ^
  -------------------------------------------------

__________________________

XXX SYNTAX ERROR, MESSAGE(S) FROM PARSER:

  error in 'test.stan' at line 2, column 3
  -------------------------------------------------
     1: data {
          ^
  -------------------------------------------------

PARSER EXPECTED: <one of the following:
  a variable declaration, beginning with type,
      (int, real, vector, row_vector, matrix, unit_vector,
       simplex, ordered, positive_ordered,
       corr_matrix, cov_matrix,
       cholesky_corr, cholesky_cov
  or '}' to close variable declarations>

The first time the error gets printed it's still truncated.

@bob-carpenter I'm pretty sure what's happening is that the diagnostic message is not being constructed correctly when the error occurs: where does that happen?

I'll take this one on and fix it.  Thanks for all the pointers.

The underlying problem is the way Boost extracts lines---if there's no end-of-line, it won't find the line by number as the parser's using.  To fix it, I'm just appending a newline to the end of every program that comes in, which should solve the problem in a way that's transparent to the user.
The data { thing is a separate error, but I'll try to fix that one in this pull request, too.


should add heka to document

should add heka to document
"Other Libraries and Tools"
https://github.com/mozilla-services/heka/

This should be opened (or even better PR'd) on the documentation repo: https://github.com/influxdb/influxdb.org


Add this.state to locals

According to koajs doc:

ctx.state
The recommended namespace for passing information through middleware and to your frontend views.
this.state.user = yield User.find(id);

That's why I propose this PR, just adding this.state to locals.
Could also solve another way issue #1

Thanks!


Grub theme configuration

Describe the solution you'd like
Add an option to configure a grub theme
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context

Some standard themes or the ability to paste a link from a site like https://www.gnome-look.org/browse?cat=109&ord=rating OR https://github.com/jacksaur/Gorgeous-GRUB

Solution for Configuring a GRUB Theme
Describe the Solution You'd Like
To provide a solution for configuring a GRUB theme, a script can be created that allows users to select a theme from the themes available in the /boot/grub/themes directory. This script would automate the process of applying a GRUB theme by backing up the current configuration, installing the selected theme, and updating the GRUB configuration.
Script Overview
The following script dynamically lists the available themes in the specified directory and allows the user to select one. Once a theme is selected, it configures GRUB to use the chosen theme, enabling the GRUB menu with a 60-second timeout and setting the graphics mode to auto. The script also backs up the existing GRUB configuration before making any changes, ensuring that the original settings can be restored if needed.
Implementation
#!/bin/bash

# GRUB Theme Installer Script

# Theme directory
THEME_DIR='/boot/grub/themes'
THEME_NAME=''

# Function to display menu and install selected theme
function select_theme() {
    # Get the list of theme directories in THEME_DIR
    themes=($(ls -d "${THEME_DIR}"/*/ | xargs -n 1 basename))
    themes+=("Quit")  # Add a Quit option at the end

    if [ ${#themes[@]} -eq 1 ]; then
        echo "No themes found in ${THEME_DIR}. Please add themes before running the script."
        exit 1
    fi

    PS3='Choose The Theme You Want: '
    select THEME_NAME in "${themes[@]}"; do
        if [ "${THEME_NAME}" == "Quit" ]; then
            echo 'Exiting...'
            exit 0
        elif [[ " ${themes[@]} " =~ " ${THEME_NAME} " ]]; then
            echo "Installing ${THEME_NAME} Theme..."
            break
        else
            echo "Invalid option"
        fi
    done
}

# Function to check for root access
function check_root() {
    if [[ $EUID -ne 0 ]]; then
        echo "This script must be run as root. Please use sudo."
        exit 1
    fi
}

# Function to backup the current GRUB config
function backup_grub() {
    cp -an /etc/default/grub /etc/default/grub.bak
    echo "Backup of GRUB config created at /etc/default/grub.bak"
}

# Function to install the selected theme
function install_theme() {
    # Create the theme directory if it doesn't exist
    if [[ ! -d "${THEME_DIR}/${THEME_NAME}" ]]; then
        echo "Error: Theme ${THEME_NAME} does not exist."
        exit 1
    fi

    # Set the theme in the GRUB config
    sed -i '/GRUB_THEME=/d' /etc/default/grub
    echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub
    echo "Theme ${THEME_NAME} installed."
}

# Function to configure GRUB
function config_grub() {
    # Enable GRUB menu
    sed -i '/GRUB_TIMEOUT_STYLE=/d' /etc/default/grub
    echo 'GRUB_TIMEOUT_STYLE="menu"' >> /etc/default/grub

    # Set GRUB timeout to 60 seconds
    sed -i '/GRUB_TIMEOUT=/d' /etc/default/grub
    echo 'GRUB_TIMEOUT=60' >> /etc/default/grub

    # Set GRUB graphics mode to auto
    sed -i '/GRUB_GFXMODE=/d' /etc/default/grub
    echo 'GRUB_GFXMODE="auto"' >> /etc/default/grub
}

# Function to update GRUB
function update_grub() {
    grub-mkconfig -o /boot/grub/grub.cfg
    echo "GRUB configuration updated."
}

# Main function to run the theme installation process
function main() {
    check_root
    select_theme
    backup_grub
    install_theme
    config_grub
    update_grub
    echo "GRUB Theme Update Successful!"
}

main

Describe Alternatives You've Considered

Standard Themes: Including a set of standard themes within the script itself, but this could limit customization and would require regular updates to keep the themes current.

Downloading Themes from URLs: The script could be extended to allow users to paste a URL from theme repositories like GNOME-Look or Gorgeous-GRUB. The script would then download and extract the theme automatically. This approach would provide users with greater flexibility and access to a broader range of themes but would require additional functionality for handling downloads, verifying theme files, and managing dependencies.

Additional Context
This script is designed to make it easy for users to apply a GRUB theme by selecting one from the available directories. The focus is on simplicity and reliability, ensuring that users can update their GRUB theme with minimal effort. Future versions of the script could incorporate additional features like theme downloads or a library of standard themes to further enhance the user experience.

#493

Added in #493
/close