Build Issue DAO Tokens Form

This ticket covers the 'Issue DAO Tokens' proposal form.
Designed layout here: https://www.figma.com/file/9lCwprCNaoAmUDmiMQpFEA/DAOhaus-v3?node-id=5610%3A117636
Proposal Data
Type: Token Proposal
Proposal info that will appear on the proposal details: 'This proposal mints or removes tokens for DAO membership. Be sure to look at the contract details for more information.'
Form Fields

Token Proposal (subheader)
Issue DAO Tokens (h2)
'Request membership or increased stake in the DAO. Any tribute must be available in your wallet when proposal is executed. ' (instructional text)
Basics (should be the same on all proposals:

Proposal Name (required, text field)
Description (text area)
Link (placeholder 'http://', text field)

TOKENNAME Tokens Requested (TOKENNAME = voting token name for DAO, text field, numbers only)

Info dot: 'These tokens provide voting privilege and membership in the DAO'

NOVOTETOKENNAME Tokens Requested (NOVOTETOKENNAME = non voting token name for DAO, text field, numbers only)

Info dot: 'These tokens provide non-voting, economic membership in the DAO'

Add Expiration - https://github.com/HausDAO/daohaus-monorepo/issues/498

Transaction details
This will call the baal submitProposal
    function submitProposal(
        bytes calldata proposalData,
        uint32 expiration,
        uint256 baalGas,
        string calldata details
    )

expiration: timestamp
-baalGas: gwei
details - is the json detail string

include type: 'issueFunding' or something

Proposal action data:
1 to many actions

can send an array of addresses to mint/burn for many at once

contract: baal
function: mintShares/mintLoot
args:
-address[] calldata to
-uint256[] calldata amount

design work done, ready for review.

@adriennetilley should we have a recipient field on this one too so you can make it for someone else?

Sorry I missed the Q! Just saw it once it was closed in my email. Seemed like a good idea to add that recipient field, if it didn't get added we can file an improvement later.


TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Triggering TagBot for merged registry pull request: https://github.com/JuliaRegistries/General/pull/48247

Triggering TagBot for merged registry pull request: https://github.com/JuliaRegistries/General/pull/48458

Triggering TagBot for merged registry pull request: https://github.com/JuliaRegistries/General/pull/54522


Improve GoThemis error introspection

GoThemis-specific errors (mostly early parameter checks) are now available as constants if you need to check for them specifically.
encrypted, _, err := scell.Protect(message, nil)
if err == errors.MissingKey {
        // you forgot to set the key
}

(Normally these are programming errors, so you'd check for such conditions before calling GoThemis API. The error constants are for cases when that's not possible.)
Add numeric error code to ThemisError struct, accessible via Code() method. Now it will be possible to communicate Themis Core errors to the user code. This is intended for programmatic consumption. Human-readable descriptive message is still available via the standard Error() of the error interface.
encrypted, err := smessage.Wrap(message)
if err != nil {
        if themisErr, ok := err.(*errors.ThemisError); ok {
                if themisErr.Code() == errors.NotSupported {
                        // uh-oh...
                }
        }
}

(Normally, you do not need to look at the error code. You can see how verbose this is in the code. This API is introduced mostly to unify error reporting with other platforms that retain error code. Plus, there are rare cases in our practice when we need access to original error codes.)
For GoThemis developers
Errors with code can be constructed using NewWithCode() constructor. Existing code sites have been updated to use it for reporting various early warnings about invalid arguments. Themis Core checks for these violations too, we do these checks in Go to be able to provide more specific descriptions to users.
Note that there are still uses of errors.New(). Not all— I mean, all CGo call sites right now do not return Themis Core errors. This will be refactored eventually. For now, these call sites with use a placeholder THEMIS_FAIL as the code, which is going to be correct in 99% cases.
Also note that we now export error code constants. All of this makes it easier for user code to decide on an error type. It will also make it easier for us to write new CGo code as we can keep use of C to minimum.
Checklist

[X] Change is covered by automated tests
[X] The coding guidelines are followed
[X] Public API has proper documentation
[X] Example projects and code samples are up-to-date (no significant changes)
[X] Changelog is updated

All of this is new public API so if you have naming suggestions, you'd better voice them now. Comments on error descriptions are welcome too, though they are easier to change as they are not a part of API. (Well, strictly speaking they are, but I won't feel sorry for breaking brittle code that depends on them.)


Unable to install

Error : package or namespace load failed for ‘melonnpan’ in loadNamespace(package, lib.loc):
cyclic namespace dependency detected when loading ‘melonnpan’, already loading ‘melonnpan’
Error : unable to load R code in package ‘melonnpan’
ERROR: lazy loading failed for package ‘melonnpan’

removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/melonnpan’
Installation failed: Command failed (1)

Hey @JoannaDrx - I just pushed an update - could you please let me know if that resolves the installation issue on your end?

Yes, it works now! Thank you for the quick update.


xSQLServerConfiguration: Should Be Cluster Aware

Details of the scenario you tried and the problem that is occurring:
When the xSQLServerConfiguration resource is applied to all of the nodes in a Failover Cluster Instance (FCI), all of the nodes will connect to the instance and ensure the desired state is true even if the node is not currently hosting the instance.
The DSC configuration that is using the resource (as detailed as possible):
When the following configuration is applied to two or more nodes in a FCI.
xSQLServerConfiguration 'SQLConfigPriorityBoost'
{

    SQLServer       = 'localhost'
    SQLInstanceName = 'MSSQLSERVER'
    OptionName      = 'priority boost'
    OptionValue     = 1
    RestartService  = $false
}

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Any
What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
Any
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Any

The resource should evaluate if the current node is actively hosting the SQL instance. If it is not hosting the instance, it should write a verbose message stating that it does not own the instance, and then silently exit.

To resolve this issue, a parameter called ProcessOnlyOnActiveNode should be created on the Set-TargetResource and Test-TargetResource functions.
The Get-TargetResource function will execute the helper function Test-ActiveNode to determine if the current node is actively hosting the SQL instance and return the result via the read-only property IsActiveNode.
The Test-TargetResource function will use the value of ProcessOnlyOnActiveNode and IsActiveNode to determine if it should continue. If ProcessOnlyOnActiveNode is $true and IsActiveNode is $false, Test-TargetResource will return $true.
I put together this gist as a guide to updating the resource.
Also, see the xSQLServerAlwaysOnAvailabilityGroup resource for a completed example.


how to trigger didSelectItemAtIndex: if I put a button in the cell

New issue checklist

[x] I have reviewed the README and documentation
[x] I have searched existing issues and this is not a duplicate

General information
show my code:
- (NSInteger)numberOfItems{
    return self.data.count;
}

- (CGSize)sizeForItemAtIndex:(NSInteger)index {
    CGFloat width = ([self.collectionContext containerSize].width - self.minimumLineSpacing * 5) / 4;
    return CGSizeMake(width, width);
}

- (__kindof UICollectionViewCell *)cellForItemAtIndex:(NSInteger)index{
    UICollectionViewCell *cell = [self.collectionContext
                                  dequeueReusableCellOfClass:[UICollectionViewCell class]
                                  forSectionController:self
                                  atIndex:index];

    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    // my settings...
    [btn addTarget:self action:@selector(didClickbutton:) forControlEvents:UIControlEventTouchUpInside];

    [cell.contentView addSubview:btn];

    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(cell.contentView);
    }];

    return cell;
}

- (void)didSelectItemAtIndex:(NSInteger)index{
    NSLog(@"item %@ clicked", self.data[index]);
}

- (void)didClickButton:(UIButton *)button {
    // what's the index ???
}

If I didn't add button to the cell, the didSelectItemAtIndex: will fire, and if I put a button in it, can't.
Sure I can use plain text and image in cell, but first, it's lack of highlight effect, second, why can't I add a button? or how can I click a button and get the index of the button

@walkerwzy you could either disable the userInteraction on the button or just set the tag value of the button to the index (mind that this can change after removing or adding objects)

I feel your desired effect is something similiar to the "Empty View Controller" demo we have in the example pack. Where the individual cells have buttons, but the effect of the button wants to be received from the section controller. Maybe take a look at that example for a bit of guidance on this.
Either way in the section controller class you can access the collection context (self.collectionContext) of which has a method on it index(forCell cell: Any!, sectionController: Any!) -> Any!. By passing the cell the button is in, and self for the section controller you will in turn receive the index.

Echoing @Sherlouk, would definitely look at the examples. I would avoid adding the button to your cell in cellForItemAtIndex: and instead the cell should own the button, add itself as the target/action, and use a delegate of the cell to receive events about button taps.
https://github.com/Instagram/IGListKit/blob/master/Examples/Examples-iOS/IGListKitExamples/Views/RemoveCell.swift#L37
FWIW the button in that example does not trigger didSelectItemAtIndex:.

@MarvinNazari yes, tag could be a straightforward way.
and I missed the EmptyViewController example, and yes, delegate it's also a way.
though each of this not trigger didSelectItemAtIndex:, but it's not necessary


prunestats inconsistent / inaccurate

What's the version of restic you used? Please include the output of restic version in your bug report.
restic 0.14.0 compiled with go1.19 on linux/amd64
What commands did you execute to get to where the bug occurred?
The starting point is a ~ 3,2 TiB repository pre 0.14.0. I then:

updated restic and migrated the repository to v2
ran: restic prune --compression max --pack-size 64 --repack-uncompressed --repack-small --no-cache
This run got OOM killed at about 50-60%; I upgraded memory and continued
ran: restic prune --compression max --pack-size 64 --repack-uncompressed --repack-small --no-cache --dry-run
ran: restic prune --compression max --pack-size 64 --repack-uncompressed --repack-small --no-cache

I do not have any logs of the first restic prune run.
What did you expect?
I expected that prune dry-run and wet run behave the same (deterministic) regarding the stats they show. And I expect the numbers to be correct in any case.
What happened instead?
Log of 2nd prune:
loading indexes...
loading all snapshots...
finding data that is still in use for 842 snapshots
[38:23] 100.00%  842 / 842 snapshots
searching used packs...
collecting packs for deletion and repacking
[7:12] 100.00%  736014 / 736014 packs processed

to repack:      **15759546 blobs / 3.151 TiB**
this removes:    1146545 blobs / 93.147 GiB
to delete:       **3723161 blobs / 1.768 TiB**
total prune:     4869706 blobs / 1.859 TiB
remaining:      14613001 blobs / 3.060 TiB
unused size after prune: **16777215.991 TiB** (100.00% of remaining size)

Log of 3rd prune:
loading indexes...
loading all snapshots...
finding data that is still in use for 842 snapshots
[35:23] 100.00%  842 / 842 snapshots
searching used packs...
collecting packs for deletion and repacking
[7:44] 100.00%  736014 / 736014 packs processed

to repack:      **15828929 blobs / 3.154 TiB**
this removes:    1215928 blobs / 97.818 GiB
to delete:       **3653778 blobs / 1.765 TiB**
total prune:     4869706 blobs / 1.861 TiB
remaining:      14613001 blobs / 3.058 TiB
unused size after prune: **16777215.989 TiB** (100.00% of remaining size)

deleting unreferenced packs
[23:54] 100.00%  88673 / 88673 files deleted
repacking packs
[11:53:12] 12.91%  86136 / 667243 packs repacked

There is a discrepancy between dry-run and wet-run in terms of blobs to repack and blobs to delete. Dry-run shows the respective blocks as to delete whereas wet-run shows them as to repack. Additonally, the unused size after prune is definitely inaccurate.
Are you aware of a way to reproduce the bug?
No.

After a bit of digging, I think I have an explanation for the behavior.

The code to handle duplicate blobs may select different pack files to keep each time it runs. That is it is perfectly valid to have small variations in the amount of data that is kept/repacked by prune.
The "unused sized after prune" obviously overflows. This is probably caused by a new edge case that only appears when compressing an existing repository: it is now possible for multiple instances of a blob to exist which have a different length. The first instance of a blob is added to the used blob size, whereas all later instance are counted as duplicates. Now, if some instance other than the first blob instance is kept, we have all necessary ingredients. The first instance and the selected instance can now differ in their size and thereby lead to a wrong blob size counter.

The side effects of the blob size accounting problems are limited though: prune will just repack a bit more data than necessary, but the repository won't be damaged in any way.

Thank you for investigating.

but the repository won't be damaged in any way.

That is reassuring for sure and I can confirm that.

The code to handle duplicate blobs may select different pack files to keep each time it runs. That is it is perfectly valid to have small variations in the amount of data that is kept/repacked by prune.

Is that something restic could inform users (e.g. only for dry-run as that one is likely "repeated") about?


Device data overview

Should read: how you can manipulate the data being sent by your virtual device.
Distinguish between basic or simple value types (string, number, boolean) vs complex value types (objects).
Please explain properly what is an integer and a number. Numbers include integers, basically is either a float or an integer. In math terms a number is a real number, although computers cannot hold irrational numbers, just for FYI.
Please use json for highlighting.
Link to WiFi and RSSI.

Addressed in bfdd8b3b54d15fcef221f16ca6a89162e2574940


Flake8 rule 'D101' reported an invalid point

Flake8 reported an invalid point for the rule D101, with the messge Missing docstring in public class.

from abc import abstractmethod, ABCMeta
import json
import re

Debug information:
Atom version: 1.22.1
Flake8 version: 3.5.0 (flake8-docstrings: 1.1.0, pydocstyle: 2.1.1, mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.6.0) CPython 3.6.2 on Darwin

Are you able to share the file in the state that shows this error? If not, can you create a minimal reproduction case that you can share?

Closing due to a lack of response.


HBASE-26550 Make sure the master is running normally before accepting…

… a balance command

:confetti_ball: +1 overall

Vote
Subsystem
Runtime
Comment

+0 :ok:
reexec
1m 17s
Docker mode activated.

Should this be called in MasterRpcServicces method or here? I can not fully recall the suggested pattern...

Heh, I had to ask myself the same question!
I saw other instances (like mergeRegions() https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java#L2045-L2051) which did this in HMaster rather than in MasterRpcServices. I think this change is in the correct place.


PS: Initial prom metrics

Fixes #1819

This change is

We have metrics in the PS already now. This is no longer needed.


Do persist IncrementalIndex in another thread in IndexGeneratorReducer

This PR has significant memory pressure changes in the reducer and changes the default behavior.
With this PR the JVM now holds onto 2 incremental index objects and the persist objects at the same time (instead of 1 incremental index object and the persist objects). This is a notable increase in memory pressure and should not be enabled by default.
To get around such constraints, the executor service can default to the sameThreadExecutorService and use a blocking service with a set backpressure size as an option.
Such an option could be represented by "io.druid.index.persist.background.count" or similar, which defaults to 0. In the case of 0 the sameThreadExecutorService can be used, in the case of > 0 the executor service with a blocking queue could have its capacity set to the config value. In the case of < 0 is an error.
There are use cases where this can be very handy, but this PR needs some major JVM heap pressure benchmarks before such behavior can be turned on by default.

Yes, the memory will increase so may be we should decrease the rowFlushBoundary.

Agree with @drcrallen, would be good to have this as an option that is off by default for reasons of increased memory pressure and increased cpu usage (2 threads instead of 1).

@drcrallen @gianm
Yes, with the latest patch this feature is an option and turn off by default .

@binlijin can you pull from master and merge into this PR? it'll help with the failing travis-ci checks

@fjy Yes, it is ok now.

@drcrallen @gianm @himanshug what about now?

:+1: after https://github.com/druid-io/druid/pull/2149/files#r49475041 is resolved.

What else can i do for the merge？we use this feature in our hadoop build job.

@binlijin can we put a description in the PR that explains what problem this is solving?

rebase

@binlijin Can you update the description of the problem being solved with this PR?

@xvrl  @fjy  update the description

:+1:, this looks good to me,
@drcrallen : I think this can be merged, if you dont have any outstanding comments ?

:+1:


Add an FAQ to Readme

Some possible questions:

Why does my app stay in a PENDING state for a long time? This probably means that the image couldn't be pulled for one reason or another. Check docker logs on the container instance for details.
I've authenticated with empire but I still see "Request not authenticated" errors You need to be using the latest version of the hk client.
Does Empire work with Kubernetes/Mesos/Whatever Yes!...if you implement it! Empire was designed to support pluggable scheduling backends. ECS proved to be the best solution for our use case. Adding support for another cluster manager would involve implementing the scheduler.Manager interface.
How does Empire differ from deis/flynn/etc Empire tries to do less than all of these things. Empire shovels a lot of responsibility onto AWS; ECS manages running processes, ELB's manage zero downtime, etc.
Can I deploy with git? No
What about logging? Empire doesn't have any logging out of the box. We use a combination of logspout, heka and dockermetrics to aggregate logs and metrics. We should do a blog post about our setup.
Why does emp dynos always show 0s as the run time? ECS currently doesn't provide any visibility into how long a given task has been in a RUNNING or PENDING state. Hopefully this will change in the future.
Why don't I see any changes to my running processes when I scale to a new process size? Scaling a process size doesn't re-submit the app to the scheduling backend. You'll see the changes reflected once you deploy a new version of the app.
Does empire support websockets? Not right now, but we plan on making the ELB integration more configurable to support this.

We have an FAQ in the docs.


mixcloud: support embed extraction

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

[X] I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

[X] I'm reporting that yt-dlp is broken on a supported site
[X] I've verified that I have updated yt-dlp to nightly or master (update instructions)
[X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
[X] I've checked that all URLs and arguments with special characters are properly quoted or escaped
[X] I've searched known issues and the bugtracker for similar issues including closed ones. DO NOT post duplicates
[X] I've read the guidelines for opening an issue
[X] I've read about sharing account credentials and I'm willing to share it if required

Region
DE
Provide a description that is worded well enough to be understood
It seems mixcloud is assumed to be supported, thus the issue.
I have two kinds of URLs to use here, one is like that you can see complete output below, the other is
https://www.mixcloud.com/widget/iframe/?light=1&feed=%2FSonarFestival%2Flaurent-garnier-live-at-sónar-2013-sat-15th-june%2F
P.S.: the checkbox for "I've checked that all provided URLs are playable in a browser with the same IP and same login details *" is a lie (i tried other "equal" ones from Laurent Garnier's side, yesterday)
Provide verbose output that clearly demonstrates the problem

[X] Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
[X] If using API, add 'verbose': True to YoutubeDL params instead
[X] Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output
p$ yt-dlp -vU 'https://player-widget.mixcloud.com/?hide_cover=1&mini=1&light=1&feed=%2Flaurentgarnier%2F2012-berlin-lbs-berghain%2F'
[debug] Command-line config: ['-vU', 'https://player-widget.mixcloud.com/?hide_cover=1&mini=1&light=1&feed=%2Flaurentgarnier%2F2012-berlin-lbs-berghain%2F']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version<EMAIL_ADDRESS>from yt-dlp/yt-dlp [7ead7332a] (zip)
[debug] Python 3.10.14 (CPython x86_64 64bit) - Linux-6.1.97-ideapad-x86_64-with-glibc2.39 (OpenSSL 3.3.1 4 Jun 2024, glibc 2.39)
[debug] exe versions: ffmpeg 7.0.1 (fdk,setts), ffprobe 7.0.1
[debug] Optional libraries: sqlite3-3.46.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1834 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version<EMAIL_ADDRESS>from yt-dlp/yt-dlp
yt-dlp is up to date<EMAIL_ADDRESS>from yt-dlp/yt-dlp)
[generic] Extracting URL: https://player-widget.mixcloud.com/?hide_cover=1&mini=1&light=1&feed=%2Flaurentgarnier%2F2012-berlin-lbs-berghain%2F
[generic] ?hide_cover=1&mini=1&light=1&feed=/laurentgarnier/2012-berlin-lbs-berghain/: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] ?hide_cover=1&mini=1&light=1&feed=/laurentgarnier/2012-berlin-lbs-berghain/: Extracting information
[debug] Looking for embeds
ERROR: Unsupported URL: https://player-widget.mixcloud.com/?hide_cover=1&mini=1&light=1&feed=%2Flaurentgarnier%2F2012-berlin-lbs-berghain%2F
Traceback (most recent call last):
  File "/usr/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1622, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1757, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/bin/yt-dlp/yt_dlp/extractor/common.py", line 740, in extract
    ie_result = self._real_extract(url)
  File "/usr/bin/yt-dlp/yt_dlp/extractor/generic.py", line 2521, in _real_extract
    raise UnsupportedError(url)
yt_dlp.utils.UnsupportedError: Unsupported URL: https://player-widget.mixcloud.com/?hide_cover=1&mini=1&light=1&feed=%2Flaurentgarnier%2F2012-berlin-lbs-berghain%2F

the checkbox for "I've checked that all provided URLs are playable in a browser with the same IP and same login details *" is a lie (i tried other "equal" ones from Laurent Garnier's side, yesterday)

what does this mean? why didn't you check these URLs? do they not play in browser?
why are you passing the iframe/widget URLs instead of the actual URLs? do we need to support embed extraction for this site?

Hello.
No it meant i have the browser in the "secweb" container open, with which i do not visit such things.  (github/lab is weird enough).
So i tried it out and can tell you both URLs work in firefox-bin as compiled by Mozilla themselves just fine.
Regarding the iframe/widget.  I have no idea of yt-dlp and its internal workings.  But if i play that thing in the browser the URL remains the same, it seems script driven that the big picture then becomes a small one and the timeline becomes visible.
Does this help?  Thank you for yt-dlp!

Hello.
bashonly wrote in
@.***>:
|I guess what I should have asked is where are you getting these iframe/w
|idget URLs from?
Laurent Garnier('s managed site) at
https://www.laurentgarnier.com/lg--subpage--km--dj_set_audio.html
has most soundcloud, but also these.  (In firefox at least, if you
click on one of the pictures, you get a picture line at the bottom
of the window, and can then navigate with cursor in there.)
--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

actually i only just now realized that mixcloud offers then an URL that leads to a page without that embedded player, and yt-dlp can indeed download these things just fine!!
Thanks a bunch!
Ciao, and keep on going!


python310Packages.psrpcore: 0.2.1 -> 0.2.2

Diff: https://github.com/jborean93/psrpcore/compare/refs/tags/v0.2.1...v0.2.2
Changelog: https://github.com/jborean93/psrpcore/blob/v0.2.2/CHANGELOG.md
Description of changes
All tests are now passing on Python 3.11

Things done

Built on platform(s)

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

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] 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
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
23.05 Release Notes (or backporting 22.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[ ] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 218902 run on x86_64-linux 1

6 packages built:

atomic-operator
crackmapexec
python310Packages.psrpcore
python310Packages.pypsrp
python311Packages.psrpcore
python311Packages.pypsrp


Could not find MIME for Buffer

This error pops up in the logs occasionally:
Error: Could not find MIME for Buffer
at image-bitmap.js:187:15
Can I just ignore it, or does it indicate a problem?

Probably just an image failed to load. If you can find a page that consistently causes it, I can investigate, but I wouldn't say it indicates a problem.

Here's a URL that consistently produces that "Could not find MIME for Buffer " error:
http://change.org/LetReadersRead
That URL also consistently produces a "startsWith" stack trace, I don't know if I should create a separate issue for it:
TypeError: Cannot read properties of null (reading 'startsWith')
at retro-proxy/index.js:88:21
at runMicrotasks ()

Fixed in b66d9d1da74a328d381800c9b73b6a13662f40e8
It was trying to process a SVG image. I haven't found a promising module for rendering those, so for now I'm removing them from pages.


Overlay tiles with a subset do not have more detail

With this PR, raster overlay tiles with a subset are always deemed to have no more detail available. This is correct because the presence of a subset indicates that the tile we want to load wasn't available, and so we're using the nearest ancestor tile that actually exists. That ancestor is, by construction, the most detailed tile available for this area.
Previously, we would think there was more detail available if the nearest ancestor tile happened to think so originally. For example, consider tile B which is a child of tile A. Tile A loads successfully, but because it's not at the tile provider's "max level", we assume that more detail is available. Then, for another geometry tile, we attempt to load tile B. This fails (because the tile doesn't actually exist), so we end up using a subset of A instead. But because A originally was marked "more detail available", the new geometry tile thinks its raster overlays have more detail available, too. Which can mean we waste time upsampling this geometry tile to hang this phantom extra detail on. In some contexts (such as when zoomed in really close, or when traversing exhaustively), this process can continue until we're working with some very tiny tiles, perhaps causing a crash when we run out of memory.

Thanks @kring ! Seems straightforward to me, so I'll go ahead and merge. But let me know if there's any specific cases I should have tested.


Add visual regression testing tool Percy

What
Visual regression testing compares screenshots, highlighting any changes made. Taking the screenshots is reasonably easily, but the storage and approval of any changes is more difficult. Enter Percy - a useful tool to do both store the screenshots and approve them.
Percy is run in a GitHub Action which is triggered when a pull request is marked as ready for review. This is to cut down on the number of screenshots taken - a single round of visual regression tests takes about 300 screenshots. Triggering this on every push would likely use up all of our allowance.
Percy has been set up to only use one browser, but due to a known bug with Percy this won't happen until Percy can compare against the main / master branch.
Why
With the number of components contained in this repo, it can be useful to run a visual regression test on every component to easily flag any changes that could have bled over.
Known problems

~Transition countdown changes each day as the deadline approached, causing a visual difference to be flagged~
~Contextual sidebar contains the transition countdown component, causing a visual difference to be flagged~
Image card has random images, so can trigger Percy to flag a change (being fixed in https://github.com/alphagov/govuk_publishing_components/pull/1795)
Sometimes organisation logos don't appear as they time out, causing a a visual difference to be flagged 🤷♀ I can't reliably replicate this problem, but I'll raise it as an issue for future reference.
Only runs when a draft pull request is marked 'ready for review'.

Visual Changes
No visual changes.
Trello card

Awesome stuff Ian, this looks super cool. I've only looked briefly at the code and had a few questions rather than a review at this point.
What is Percy comparing against? I can't see at what point Percy knows that something is good. Looking at https://percy.io/55ba5e1a/govuk_publishing_components/builds/8039557 seems to show a comparison between current and earlier versions of your branch. How do set the baseline?
I'm guessing we can't run this on Jenkins because of the requirement of it being a PR and that PR being ready for review. However I was wondering about when we hopefully migrate this repo to Github Actions. Would this be a task that we could configure as part of a wider CI action and have the Percy steps conditional? It feels like most of the action file would be the same pre-requisities for doing the rest of CI so would be a shame to duplicate.
Btw, there are developer docs on conventions in GitHub actions that could help make the actions file here more consistent: https://docs.publishing.service.gov.uk/manual/test-and-build-a-project-with-github-actions.html#govuk-rails-application-with-postgres-redis-yarn-and-govuk-content-schemas-dependencies - there's also been a long running issue with using secrets in GitHub actions which I think is just about resolved. May just need to give GOV.UK Senior Tech a nudge to say it's happening.
There may also need to be a tweak in govuk-saas-config to make the percy check a required check. I'm not sure whether the sass config script would override settings in the repo.

Thanks for taking a look @kevindew - really appreciate it 👍

What is Percy comparing against?

Percy compares against a chosen branch - for this repo it's the master branch, but it could be any branch set in the Percy's admin settings. If Percy can't do that it'll compare against last set of screenshots from the current branch.
So Percy will take screenshots of the master branch once this has been merged in; any subsequent pull requests will be compared against the master branch's screenshots.

Would this be a task that we could configure as part of a wider CI action and have the Percy steps conditional?

I couldn't find a way of saying "run all test on pushes and pull requests, but only run this step if marked as ready", which is why I didn't put it in a workflow named ci.yml. If it can be done then super, but I don't think it should be a blocker to getting this merged in.

Btw, there are developer docs on conventions in GitHub actions that could help make the actions file here more consistent...

Brill - thanks for sharing. I'll update the action to follow these conventions.

...there's also been a long running issue with using secrets in GitHub actions which I think is just about resolved. May just need to give GOV.UK Senior Tech a nudge to say it's happening.

My understanding is that this was about using secrets to deploy sites, not to run tests; and that this issue has been resolved. I'll ask a Senior Tech to take a look to be on the safe side.

There may also need to be a tweak in govuk-saas-config to make the percy check a required check. I'm not sure whether the sass config script would override settings in the repo.

I think that this shouldn't be a required check quite yet - people that need to approve should make sure they have a Browserstack account (Browserstack are Percy's parent company) so they have the correct permissions. Once we're sure of that people can access this tool, then this can be changed to a required check.

Just one comment - some docs around this would be great, for example to include the stuff about needing a Browserstack account and permissions.

Percy compares against a chosen branch - for this repo it's the master branch, but it could be any branch set in the Percy's admin settings. If Percy can't do that it'll compare against last set of screenshots from the current branch.
So Percy will take screenshots of the master branch once this has been merged in; any subsequent pull requests will be compared against the master branch's screenshots.

Ah neat, is this something that is configured with a Percy UI?

Would this be a task that we could configure as part of a wider CI action and have the Percy steps conditional?

I couldn't find a way of saying "run all test on pushes and pull requests, but only run this step if marked as ready", which is why I didn't put it in a workflow named ci.yml. If it can be done then super, but I don't think it should be a blocker to getting this merged in.

Cool - hopefully we won't be too far away from switching this project to a GitHub Action and can try integrate it.

My understanding is that this was about using secrets to deploy sites, not to run tests; and that this issue has been resolved. I'll ask a Senior Tech to take a look to be on the safe side.

The restriction was unfortunately any usage of secrets at all. But yes, you're right that this should be resolved. I raised it as this will be our first sanctioned usage of a GitHub Action secret.

I think that this shouldn't be a required check quite yet - people that need to approve should make sure they have a Browserstack account (Browserstack are Percy's parent company) so they have the correct permissions. Once we're sure of that people can access this tool, then this can be changed to a required check.

Ah sure - so I assume everyone can see the results of a Percy build but only authenticated users have the ability to approve? I've got a Browserstack account myself but no idea how widespread they are.

Percy compares against a chosen branch - for this repo it's the master branch, but it could be any branch set in the Percy's admin settings. If Percy can't do that it'll compare against last set of screenshots from the current branch.
So Percy will take screenshots of the master branch once this has been merged in; any subsequent pull requests will be compared against the master branch's screenshots.

Ah neat, is this something that is configured with a Percy UI?

Yes, it's set with the Percy admin UI - so when the master to main change happens it'll need to be updated.

My understanding is that this was about using secrets to deploy sites, not to run tests; and that this issue has been resolved. I'll ask a Senior Tech to take a look to be on the safe side.

The restriction was unfortunately any usage of secrets at all. But yes, you're right that this should be resolved. I raised it as this will be our first sanctioned usage of a GitHub Action secret.

Ooh, didn't realise that this was the first. I asked @richardTowers to take a look to see if this is an acceptable use of a secret.

I think that this shouldn't be a required check quite yet - people that need to approve should make sure they have a Browserstack account (Browserstack are Percy's parent company) so they have the correct permissions. Once we're sure of that people can access this tool, then this can be changed to a required check.

Ah sure - so I assume everyone can see the results of a Percy build but only authenticated users have the ability to approve? I've got a Browserstack account myself but no idea how widespread they are.

I'm going to add some documentation to make this clearer  (thanks for the suggestion @chao-xian :) )

Oh btw thanks for updating the actions file it looks great and I have a few minor comments that I'll add later (got to dash somewhere now). However I did notice the action didn't seem to run when you pushed the change so wondered if there might be a problem to look into?

D'oh - should be fixed now; the setup-node was missing a with for the version number.

👋 weighing in just to make it clear that this is An Officially Sanctioned Use of GitHub Actions With Secrets (TM).
In this case, the secret in question isn't sensitive from an IA perspective (unlike deploy keys, or tokens that give write access to artefact stores), so we don't need to think about it in too much detail.
We still need to think about the tradeoffs we're making with GitHub Actions in the more general case, so this shouldn't be seen as a precedent implying "we can put whatever secrets we like in GHA without thinking about the consequences of doing so". For now, we should think about it on a case by case basis.

Great thanks @richardTowers, do you want to update the docs with the updated stance.
What about the use of a secret to release a gem (which is the missing piece that'll keep this project on both Jenkins and GitHub actions) - is the approach in rubocop-govuk sanctioned or not? And if still ambiguous, how can we move past the stalemate?

D'oh - should be fixed now; the setup-node was missing a with for the version number.
Hmm, it didn't run. I suspect this action only runs when the ready_for_review event is fired, not on subsequent pushes after that.

Oh, maybe just have it run on PR open? I guess it's a minority of PR's that are opened as draft.

Where are we with this now? What are the minimum steps we could take to get this over the line, if there is anything else at all? I'm not clear what else is needed @injms @kevindew @richardTowers

Where are we with this now? What are the minimum steps we could take to get this over the line, if there is anything else at all? I'm not clear what else is needed @injms @kevindew @richardTowers

I've cherry picked @kevindew's 09f8596820df372a4a41dd250e4410bcdddfad87 onto this branch - using --tag is much more elegant and future proof.
Still musing on how to run the tests as they're needed without burning through all of the monthly allowance in one pull request.

Still musing on how to run the tests as they're needed without burning through all of the monthly allowance in one pull request.

So until we have limitless money to spend on this, the best solution I can think of is to only run Percy when a pull request is marked as ready for review.
Advantages:

Only runs when a pull request is ready
Doesn't run on every push, so doesn't burn though all the credits super quick
Runs on every pull request

Disadvantages:

Doesn't run on every push, which makes it fiddly to re-run the VRTs as the pull request needs to put in and out of draft
Noisy, as there's a slack notification that pings every time a pull request is ready for review

I was trying to read up on the ready_for_review event to understand exactly when it occurs (which is barely documented), and the best I could find was:  https://frontside.com/blog/2020-05-26-github-actions-pull_request/#how-do-workflows-trigger-on-pull_request which leads me to think that this job will only get triggered in the scenario that someone opens a draft PR and then it'll run only once when they set that as ready for review. So if someone opened a PR, forgoing the draft stage this would never run. Is that how you understand it or anticipate it?

... which leads me to think that this job will only get triggered in the scenario that someone opens a draft PR and then it'll run only once when they set that as ready for review. So if someone opened a PR, forgoing the draft stage this would never run. Is that how you understand it or anticipate it?

My understanding / hope was that it would run on normal pull requests as they were raised, and when a pull request was changed from draft to ready. Reading that article makes me think otherwise - that the trigger only happens when going from draft to ready, rather than when ready.
I think I'm going to have to change this to the default - running when a pull request is raised, pushed to, or re-opened. That'll ensure that this is a useful test.
We could prevent non-essential runs by ignoring some paths in the repo or only watching certain paths in the repo - I'll do that in another pull request as I'll want to investigate what is okay to include or ignore.
If we burn through the credits then we burn through the credits - that won't prevent a pull request from being merged in since it is not a mandatory check.

... which leads me to think that this job will only get triggered in the scenario that someone opens a draft PR and then it'll run only once when they set that as ready for review. So if someone opened a PR, forgoing the draft stage this would never run. Is that how you understand it or anticipate it?

My understanding / hope was that it would run on normal pull requests as they were raised, and when a pull request was changed from draft to ready. Reading that article makes me think otherwise - that the trigger only happens when going from draft to ready, rather than when ready.
I think I'm going to have to change this to the default - running when a pull request is raised, pushed to, or re-opened. That'll ensure that this is a useful test.
We could prevent non-essential runs by ignoring some paths in the repo or only watching certain paths in the repo - I'll do that in another pull request as I'll want to investigate what is okay to include or ignore.
If we burn through the credits then we burn through the credits - that won't prevent a pull request from being merged in since it is not a mandatory check.

That sounds reasonable and a path that isn't surprising. It looked like even trying to set a check to ignore draft PR's had some surprising complications: https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/8
Be great if we can eventually get a plan so this can be less of a concern.


pkg/package-server: Add null check when attempting to initialize an API server config

Description of the change:
Update the pkg/package-server/server/server.go package and add a null
check for the config variable returned when running the Config method
for the PackageServerOptions structure. That Config method doesn't
ensure that the variable returned is populated when the error returned
is nil.
When attempting to initialize a delegating authentication configuration,
and the environment isn't properly setup (e.g. no cluster is running),
and SIGINT is sent to that process, an error will be returned from the
poll operation due to a timeout being reached, yet only the lastApplyErr
will be returned, which is nil in that scenario.
Note: this appears to only be reproducible when $KUBECONFIG is set locally, but no cluster is running, so this wouldn't be all that present in the wild.
Motivation for the change:
Properly handle signals during the package-server executable so a panic isn't produced.
Reviewer Checklist

[x] Implementation matches the proposed design, or proposal is updated to match implementation
[x] Sufficient unit test coverage
[x] Sufficient end-to-end test coverage
[x] Docs updated or added to /doc
[x] Commit messages sensible and descriptive

@timflannagan if you want to rebase this so the merge commit I added is removed, feel free.


Yellow loading indicator never stops

On the latest version, the yellow loading indicator never stops when a new wallet is created.

This is due to background processing not implemented in "web-mode" nor "desktop-mode", only in "extension-mode". Leaving the issue open until it's refactored to work in the other modes.

Support for "web-mode" has been implemented and this is no longer an issue.

This is still an issue, at least when performing a reset, restoring wallet (with zero history) in web-mode.


Allow included files to be templated

What happened?

What were you attempting to do?
I was trying to include some templated values like {{port}} in a file that I was include-ing in my nginx.conf. When my app starts the included file has not be templated and NGINX fails to start.

What did you expect to happen?
I expected that my templated files were generated with the dynamic values they require.

Build Configuration

Can you provide a sample app or relevant configuration (buildpack.yml,
nginx.conf, etc.)?

nginx.conf
worker_processes 1;
include my-file.conf;

my-file.conf
http {
  charset utf-8;
  log_format cloudfoundry 'NginxLog "$request" $status $body_bytes_sent';
  access_log /dev/stdout cloudfoundry;
  default_type application/octet-stream;
  include mime.types;
  sendfile on;

  tcp_nopush on;
  keepalive_timeout 30;
  port_in_redirect off; # Ensure that redirects don't include the internal container PORT - 8080

  server {
    listen {{port}};
    root public;
    index index.html index.htm Default.htm;
  }
}

Checklist

[x] I have included steps for reproduction.

@ryanmoran Do you expect this to work recursively for all includes? For instance, if my-file.conf from the example above included the line
include my-other-file.conf;

and my-other-file.conf contained some templating, would you expect that my-other-file.conf would have the templated values filled in as well?

@fg-j @emmjohnson I'm reopening this because I found that the configure binary would not exit non-zero when an include file does not exist. i.e. following test would fail if added to to cmd/configure/main_test.go:223
context.Focus("when an include file does not exist", func() {
        it.Before(func() {
                Expect(ioutil.WriteFile(filepath.Join(workingDir, "nginx.conf"), []byte("include donotexist.conf;"), 0644)).To(Succeed())
                command = exec.Command(path, filepath.Join(workingDir, "nginx.conf"), localModulePath, globalModulePath)
                buffer = bytes.NewBuffer(nil)
        })

        it("exits non-zero", func() {
                session, err := gexec.Start(command, buffer, buffer)
                Expect(err).ToNot(HaveOccurred())
                Eventually(session).Should(gexec.Exit(1), buffer.String)
        })
})

The only possible error case for filepath.Glob (here) is when the pattern is wrong. The binary must also make sure that the included file exists. Could you take a look?

@arjun024 This is mainly so that this has similar behaviour to the v2b Cloud Foundry buildpack, right? (See https://github.com/cloudfoundry/nginx-buildpack/blob/0f586a732af93fd9082b7c8fc5598ecec676cb41/src/nginx/varify/varify_test.go#L145)


Delete config-multi.yml

probably this is an old refuse.

Codecov Report

Merging #45 (3d7d85f) into main (0396734) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #45   +/-   ##
=======================================
  Coverage   74.44%   74.44%
=======================================
  Files           6        6
  Lines         403      403
=======================================
  Hits          300      300
  Misses         66       66
  Partials       37       37

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0396734...3d7d85f. Read the comment docs.


[ODS-4809] Integrate Latest 3.3.0-a Data Standard Work

We should update the odsApiVersion to 5.2.0 for each of these ApiModel-EXTENSION.json files. Otherwise none of these extensions are being loaded by the WebApi.

@tbmeador-dlp - I updated with 5.2.o for all extension and also updated corresponding package for plugin folder in ODS-Implementation branch .


pass a command and a job in parameter to lab ci view

What about adding a command and a job to lab ci?
Example: in my CI I have to job build and test. Let's say I want to trace the test job:
$ lab ci trace test

It would directly output the job trace and returning to the shell with a result of 0 or -1 if the job succeed or failed.

Few thoughts here:

lab supports passing in the job to lab ci trace

$ lab ci trace --help
If a job is not specified the latest running job or last job in the pipeline is used

Usage:
  lab ci trace [remote [[branch:]job]] [flags]

Aliases:
  trace, logs

Flags:
  -h, --help   help for trace

From you command probably something like
lab ci trace origin master:test

The syntax is attempting to emulate some syntax from git. On another CI related issue, I'm questioning the decision myself: https://github.com/zaquestion/lab/issues/232#issuecomment-436389898 copying that here

the idea with branch:job was to emulate how git lets do stuff like git checkout origin branch:file -- A simple extension would just be to keep the colons going lab ci artifacts origin master:myjob:path/to/my/file, but mostly I'm wonder why colon separate at all and just do lab ci artifacts [remote [ branch [ job [ path ]]]

The idea of adjust the exit code for job pass/fail is appealing. I'm not sure the trace command is the best place for it. Since a failed exit code would still indicate lab ci trace successfully printed logs. But I think the feature makes a lot of since for lab ci wait https://github.com/zaquestion/lab/issues/240

IMHO the exit code of a command should reflect if it succeeded or not, and in the lab ci trace it shouldn't have any relation to the job failing or not. For it, you could use grep  for grepping a successful message and then get the exit code of grep itself, which relates to "text found" or "text not found".
@MartinDelille, considering the command line mentioned by @zaquestion on his comment and the above statement, would that solve your concerns raised in this issue?


init: backported changes to Trim_Whitespace_Right_* primitive functions

There were some new optimization discovered when implementing Trim_Whitespace_Right_{String,Unicode} functions. Hence, let's backport those changes back to its predecessor
Index_Left_{String,Unicode}.
This patch backports changes to Trim_Whitespace_Right_{String,Unicode} primitive functions in init/ directory.

merge first since the production is unaffected.


Emoji doesn't render for typst \u{27A1}

I was trying to use the right arrow emoji, i.e with the escape code \u{27A1} named arrow.r.filled as specified under official typst document here and it does not seem to work unfortunately, while the other emojis are rendered correctly when I export the pdf.

Here is my web workspace view, it seems to me that the typst is using the "Right Arrow on Twitter / X Twemoji 15.0.1" variant instead?

Thanks for the great work!

Noto Color Emoji (the only font supported for now) does not implement it. And I don't why it should either this symbol is a Black Rightwards Arrow... so no color ;)
One way to support it would be to add more symbols from Noto [] Emoji for instance.

After looking into it, it's "a feature not a bug"!
So yes \u{27A1} is not truly an emoji. But the sequence \u{27A1}\u{FE0F} is.
Most emoji picker will input the sequence when asking for the right arrow.
I had to actually care about emoji sequence because for Noto Emoji: 0, 1, ... are emoji too
IMO Typst should change the definition of #emoji.arrow.r.filled.

Reported to typst #3915
Wontfix on my part


AddPart and alternative body

Hi,
This issue appears using AddPart as alternative body when sending Emails in Batch.
With each iteration loop, AddPart adds previous body and recipients are seeing information from another users!
setBody (Works fine)
--=swift_v4_1496488565_1fc89a9add080f4ea0dcb6488e27fa70=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi user_3,
This text appears as duplicate in each iteration loop
addPart (the last recipient receives all html body from other users)
--=swift_v4_1496488565_1fc89a9add080f4ea0dcb6488e27fa70=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi user_1,
This text appears as duplicate in each iteration loop
--=swift_v4_1496488565_1fc89a9add080f4ea0dcb6488e27fa70=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi user_2,
This text appears as duplicate in each iteration loop
--=swift_v4_1496488565_1fc89a9add080f4ea0dcb6488e27fa70=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi user_3,
This text appears as duplicate in each iteration loop
--=swift_v4_1496488565_1fc89a9add080f4ea0dcb6488e27fa70=--

Hi,
I am also facing the same issue. Is there some function like setAltBody instead of addPart. Swiftmailer already have setBody so there should be some functionality for setAltBody.
Thanks

Hey,
same issue here.
Thanks

I need this one also... I think this is a very serious issue and makes this class useless in some cases.

@raghubirthakur The solution would be to create setAltBody or removePart. Does anyone know how to unset addPart inside a loop? Thanks.

the best way to do it is to keep references to the parts and do specific
setBody on parts themselves.
if you do addPart on the original object in a loop, the behaviour is
correct.
as you are asking for the mail to be added a new part.
On Thu, Jun 29, 2017 at 4:35 PM, playinteractive<EMAIL_ADDRESS>wrote:

@raghubirthakur https://github.com/raghubirthakur The solution would be
to create setAltBody or removePart. Does anyone know how to unset addPart
inside a loop? Thanks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/swiftmailer/swiftmailer/issues/946#issuecomment-311986148,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADCfQZEEy-KU8gq74BZFC9S5sDAqF9Sks5sI7YxgaJpZM4NvD93
.

--
Xavier De Cock
GPG Fingerprint: 93CA EE3F 9F57 5BE1 AE4A  794D 3C74 CA9E E7A5 0C1B
GPG Id: 0xE7A50C1B

Hi xdexock,
Sure, addPart does its job well. But then addPart can't be used as alternative body.
foreach($value as $key) $message->setBody('text plain here')->addPart('html here'), 'text/html');
This is why we are asking here about SetAltBody or removePart at least.

ok, i understand the issue :)
the thing, is that, technically, each part, is it's own mime object by
itself.
so the best way to do it is usually to do something like that:
$text_part = Swift_MimePart::newInstance($content['text/plain'],
'text/plain', 'utf-8');
$html_part = Swift_MimePart::newInstance($content['text/html'],
'text/html', 'utf-8');
$message->attach($this->text_part);
$message->attach($html_part); /* Note if you attach image, you should embed
one layer more in multipart/related */
$message->setContentType('multipart/alternative');
and, then, you keep the reference to text_part / html_part
and do something like :
foreach ($subscriber as $email => $parts) {
$text_part->setBody($parts['text']);
$html_part->setBody($parts['html']);
}
...
it's not a one liner, but i can assure you email's a mess and if you want
things to work there's no shortcuts.
On Thu, Jun 29, 2017 at 5:09 PM, playinteractive<EMAIL_ADDRESS>wrote:

Hi xdexock,
Sure, addPart does its job well. But then addPart can't be used as
alternative body.
foreach($value as $key) $message->setBody('text plain
here')->addPart('html here'), 'text/html');
This is why we are asking here about SetAltBody or removePart at least.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/swiftmailer/swiftmailer/issues/946#issuecomment-311996723,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADCffYImKecapHFEb9hBJdXeN-ZyJ1iks5sI74igaJpZM4NvD93
.

--
Xavier De Cock
GPG Fingerprint: 93CA EE3F 9F57 5BE1 AE4A  794D 3C74 CA9E E7A5 0C1B
GPG Id: 0xE7A50C1B

Hi xdecock, thanks!
Anyways the common sense would be:
$message->setBody('text plain here')->setAltBody('html here', 'text/html');
Sorry, but setAltBody is missing in this class.

Ya, I also agree with below function
$message->setBody('text plain here')->setAltBody('html here', 'text/html');
On Jun 29, 2017 8:58 PM, "Playinteractive"<EMAIL_ADDRESS>wrote:
Hi xdecock, thanks!
Anyways the common sense would be:
$message->setBody('text plain here')->setAltBody('html here', 'text/html');
Sorry, but setAltBody is missing in this class.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/swiftmailer/swiftmailer/issues/946#issuecomment-312002568,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMae8wUK0WGyQa5jI0GJ-_WB-rGlw5Paks5sI8KmgaJpZM4NvD93
.

To be 100% honest, the magic that allow the setBody-> addPart is a really
ugly part of code, and is pretty bug prone, the layout i propose avoid this
code all together :)
(the setBody addPart magically creates the alternative wrappers, moves the
body as a subpart, ...)
i don't like magic, it often causes trouble
On Thu, Jun 29, 2017 at 6:36 PM, Raghubir Thakur<EMAIL_ADDRESS>wrote:

Ya, I also agree with below function
$message->setBody('text plain here')->setAltBody('html here', 'text/html');
On Jun 29, 2017 8:58 PM, "Playinteractive"<EMAIL_ADDRESS>wrote:
Hi xdecock, thanks!
Anyways the common sense would be:
$message->setBody('text plain here')->setAltBody('html here', 'text/html');
Sorry, but setAltBody is missing in this class.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/swiftmailer/swiftmailer/issues/946#issuecomment-
312002568>,
or mute the thread
<https://github.com/notifications/unsubscribe-
auth/AMae8wUK0WGyQa5jI0GJ-_WB-rGlw5Paks5sI8KmgaJpZM4NvD93>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/swiftmailer/swiftmailer/issues/946#issuecomment-312022544,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADCfW_fgKcauSfsZOzlKrdIqAiiP4SOks5sI9KJgaJpZM4NvD93
.

--
Xavier De Cock
GPG Fingerprint: 93CA EE3F 9F57 5BE1 AE4A  794D 3C74 CA9E E7A5 0C1B
GPG Id: 0xE7A50C1B

Sorry but this is not a solution. Using $message->attach($this->text_part) for sending the message when SetBody already exists?!

i'm glad to ear, this is not a solution.
however, this works, respects the way emails are created and should be structured, if you're not happy, there's a fork / pull request button on top of this page, the code is bsd, you can do what you want with it.
It's the free world of open source, if you're not happy with a solution, feel free to improve it.
But i assure you, this is the best way to do it.
I don't see the problem in fixing the code you did instead of trying to force a behaviour change in a library.

Hi xdecock,
I appreciate your help but I can't understand what you did.
foreach ($subscriber as $email) {
$message->setBody('body here', 'text/plain');
$message->setBody('body here html', 'text/html');
}
Is this correct?

Nope, i created specific objects for each part, that's the trick,
So you can more easily change the content of the parts without touching the
structure of the email.
i'm changing the body of htmlPart & textPart
i can't see how i can rewrite the example i posted a few replies before.
On Fri, Jun 30, 2017 at 12:08 PM, salvazo<EMAIL_ADDRESS>wrote:

Hi xdecock,
I appreciate your help but I can't understand what you did.
foreach ($subscriber as $email) {
$message->setBody('body here', 'text/plain');
$message->setBody('body here html', 'text/html');
}
Is this correct?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/swiftmailer/swiftmailer/issues/946#issuecomment-312229719,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADCfXqXHNLsNYthBbV0oYJoZsjN0_Jxks5sJMkqgaJpZM4NvD93
.

--
Xavier De Cock
GPG Fingerprint: 93CA EE3F 9F57 5BE1 AE4A  794D 3C74 CA9E E7A5 0C1B
GPG Id: 0xE7A50C1B

@xdecock I see the point in your solution, but wouldn't it be easier to just move the creation of the Swift_Message inside the loop??
I guess this is the situation everybody here is talking about:
$message = new Swift_Message();
foreach ($users as $user)
{
    $message->setBody(...);
    $mailer->send($message);
}

The real problem with this approach is that the $message object is the same for the entire loop! So any modification you're applying on $message will remain active for all subsequent iterations (unless you explicitly reset it later). Example:
foreach ($users as $user)
{
    if ($user->id===1)
    {
         // All these settings will remain active for *all* users, since they never get removed:
        $message->addCc(...);
        $message->attach(...);
        $message->getHeaders()->addTextHeader(...);
    }
    $message->setBody(...);
    $mailer->send($message);
}

The solution:
foreach ($users as $user)
{
    $message = new Swift_Message(); // fresh $message for each user!
    $message->setBody(...);
    $mailer->send($message);
}

The only drawback I can see is that you need to define the message's "basics" (From, Subject, etc.) in every iteration, but you can easily delegate this to a separate function.
Or am I missing something?
In any case, I would suggest to modify this part of the docs https://swiftmailer.symfony.com/docs/sending.html#sending-emails-in-batch and recommend whichever solution we are coming to here.
Regarding setAltBody(): I think this is a good idea. The underlying problem is that addPart() was meant for things like attachments - of which you can have multiple. But it doesn't make sense to have 1 text/plain part, and then 15 text/html alternative parts!
Since the docs say at https://swiftmailer.symfony.com/docs/messages.html#setting-the-body-content

If an alternative body is to be included, addPart() can be used.

I would implicitly assume that subsequent calls of this method would replace the alternative body, not augment it. So the main difference between the proposed setAltBody() method and addPart() would be that it had to check if a mime part of this kind is already present and then either overwrite it or add it.

I'm closing this issue as it's going to be fixed by Symfony Mailer/Mime, which will replace Swiftmailer eventually.


Filter out things without main from invocation

Right now invocation may include things with no main, which is not technically correct. We should remove them

Fixed!

Note that in some cases this may not be correct: in climcomp, there is a
scrips without main, but with body, that performs the execution. We may
need to revisit this
El mié., 4 ago. 2021 2:53 p. m., Rosa Filgueira @.***>
escribió:

Fixed!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/SoftwareUnderstanding/code_inspector/issues/219#issuecomment-892632501,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AALTIGXMRL7XMHQDPWZUENDT3EZ5ZANCNFSM5BI37LFA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email
.


Is it possible to add a vietnamese lunar calendar?

Hello,
my girlfriend is from vietnam and unfortunately I haven't found a beautiful calendar app or something similar that shows the vietnamese lunar calendar. Is it possible to support this?

Do you want the entire calendar changed or you just want to see the lunar dates alongside the gregorian dates?
You can currently change you region and some other configurations in System Preferences > Language & Region
I couldn't find vietnamese, but some of those options follow the lunar calendar.

It is enough if the vietnamese lunar dates are below the gregorian dates.
Here is a third party app that my girlfriend uses on her iPhone. So you can see what it looks like.
https://apps.apple.com/us/app/vlunar-âm-lịch-widget/id1531851878
I think there is no operating system that has the vietnamese lunar calendar integrated, so you won't find it in the system preferences.

I think the closest we have support in code is the chinese calendar. I have no idea what are the differences though.
I will leave this issue open to see if we get some help.


Maximum locations per request in API "info" endpoint

It would be nice to know, before sending a routing request to the API, what is the maximum locations per request allowed with our API key. This number varies with GraphHopper account types. E.g. 5 with Free accounts, 30 with Basic accounts, etc.
Currently, there is no way to programmatically know if my routing query with n locations will be allowed, other than issuing it and check if it returns an error or not.
My first use case is the GraphHopper Maps UI. Creating a new intermediate point could be disabled once the maximum allowed count of intermediate points is reached.
E.g. if using a free account (max. 5 locations: start, end and 3 intermediates), and you already defined 3 intermediate points, then the + icon in the left margin to add a new location would be disabled, as well as the "Add intermediate point" item in the context menu.
You should create and return a new key max_locations in the answer to the info endpoint calls.

This is not a graphhopper issue, the limits should be handled in an upper layer as this cannot be configured once but per user. Please post this here: https://discuss.graphhopper.com/c/directions-api

Similarly to #838 both are valid issues and you can immediately report them here


Restore onTrade() bail-out in a way that works

This fix undoes #2334 and fixes the problem it tried to fix, the right way, by restoring bailing out of onTrade when an old trade comes in, but this time with the call to the callback function which went missing in the changes in https://github.com/DeviaVir/zenbot/commit/17e9758eb0c2179ee81a960ffd83bcb54012c025#diff-a41b519e7979a713e894ef8d1b3fe568R347-R349 .
Because of the missing call on the callback function, the async event queue loop would break when an old trade came in. This PR restores resuming operations when a trade comes in that belongs to a previous period.
The bug, and these changes, affect only those running paper or live trading in very short timeframes such as 1s or 5s.

I've been banging my head on the code for weeks looking for this bug! Thank you thank you thank you!
How did you find it?

Reverse engineering 😳

And @DeviaVir 's comment in #2334 sure helped too.


Fix Windows issue with HTML elements

The _get_elements.mjs file was failing when trying to load a HTML file. fileURL.pathname works on UNIX but not windows because it adds and extra / at the start of a Windows path, i.e. /C:/Users/. Switching to using the file path and not url file path works on both Windows and UNIX.

Looks good! Shakes fist at windows

@brianleroux the worst part I'm having a hard time getting the test case to fail on windows when not running locally.


[Review]: Review all the notebooks and fix the any error of it

please assign me this task under hacktoberfest2023


Uninstall and Cache Invalidation Options for new plugin system

I added in this Pull Request a new method uninstall in the plugin class. This is needed in some requirements like drop tables on uninstall, mail templates etc...
My second point was to add a cache invalidation in the plugin.xml.
Example:
<cache-invalidation>
        <invalidate on="install">
            <cache>config</cache>
            <cache>proxy</cache>
        </invalidate>
        <invalidate on="activate">
            <cache>theme</cache>
        </invalidate>
        <invalidate on="uninstall">
            <cache>config</cache>
            <cache>proxy</cache>
        </invalidate>
        <invalidate on="saveConfig">
            <cache>config</cache>
        </invalidate>
    </cache-invalidation>

Special Thanks to @t2oh4e which helps me with xsd.......

@OliverSkroblin @dnoegel What is your opinion on that strategy?
I remember one argument of us was that you might want to invalidate some caches only for some update steps but not for all.

From my point of view the cache invalidation for updates should be handled by the migrations. That way each migration can invalidate the caches needed for whatever is done in the migration itself e.g. setting configuration, maniplating something.
The one method for all updates approach should be dropped imho in flavour of the migrations. That's the way we have done it with the update classes in our ReplyBase plugin: The update() methods checks for new update classes (or migrations in the new plugin system) and applies them. Every update tells which caches has to be invalidated.

Migrations is a beautiful idea, but I guess that is not planed ( I questioned it last week on irc) My idea were two new attribute fromVersion and toVersion as optional in XML to handle the caches on plugin update.

Hey @shyim and @FiveDigital,
currently we are discussing to have migrations / update files for the 5.2 final. It depends a bit on the workload - but at least from my side it is a "must have". On the other hand, there is no hurry bloating the system - one could still add it with a 5.2.1 as a non-breaking change.
Either way: We already discussed a system with install/update context objects, that will be injected to the update/install methods OR the migrations (if implemented). Those context objects will allow you to schedule cache clear operations conveniently and also to make it version dependend (e.g.: if SW 52 && Plugin-Version 2.0. && $MOON_PHASE == "full moon": clear http cache).
I really appreciate your work @shyim, but currently I am not convinced about the XML clear-cache thingy…

Oh, but we shouldn't forget this "uninstalll" thing. Looks quite useful for me :)

👍  For migrations
👍  For context objects
Can't wait to see you implementation since we already planned to build this for our ReplyBase plugin. We had some discussions about topics like how to name the migration files etc. and will provide feedback once the code is on GitHub.

@dnoegel Why are you not convinced with xml clear-cache :D? Because its xml :P?

@shyim: "Clear the cache" is another kind of issue then "My menu item is called 'test'" or "My plugin is named 'foo'". The first described behavior, the latter a state. As Thomas already stated, one wants to control when / how caches are cleared and in order to do that, you'd need to add all kind of attributes like "fromShopwareVersion", "toShopwareVersion", "fromOldPluginVersion", "toOldPluginVersion" etc. The cache invalidation might even depend on other plugins being installed or not?
Don't get me wrong, I don't want to emphasize this behavior vs state difference too much and if there are good arguments for it, I will happily encode those things into XML as well. But if the situation is, that we need to have some sort of proper cache-invalidation handling in the install/update/migration system anyway, then I don't see why we should start with the XML cache-invalidation in the first place.
Is there anything that XML cache-invalidation can do for us, that programmatic cache invalidation can't?

I also want to add that the XML files will become very large when you have many plugin updates. In our internal plugins we often have more than 50 update files and when the new migration system hopefully offers the ability to set store specific shop configuration it will become much more.

Hey,
we discussed if it makes sense that the plugin developer has to decide which different kind of caches has to be cleared.
So we took a look to our caches and which are interesting for plugin developers:

config cache => has no performance impact to clear each time
proxy cache => same here, no performance impact
router => only interesting if you have a "live" generation
theme => makes only sense if HTTP and TEMPLATE are cleared too
http => this is critical for a live system, but the customer has to decide this at the end
template => as stand alone cache, only intersting for backend

With this list of caches we had the idea that config, proxy, router and template caches have to be cleared every time on plugin crud operations and the plugin developer can define if the http and theme, the frontend cache (the critical for live systems), has to be cleared too.
What do you think about this solution?

It is a great idea, but how we can define that http and theme cache should be cleared?
In the xml way or @dnoegel said programmatic way :)
It would be interesting for my pr

As a developer I always like being in full control of what happens. So in my opinion:

it's okay to clear the caches @OliverSkroblin mentioned by default in every migration
it should be possible to define which caches should be cleared in every migration optionally
that enables me to say: don't clear any cache in this migration or: rebuild the theme and clear the http cache afterwards

Thinking in code I have an abstract class Migration that defines the caches to be cleared by default in perhaps a protected $cachesToClear = ['config', 'proxy', 'router']; member that I can override in my concrete migration class that extends the Migration.

Hey, we implemented a context class which are provided to the activate/deactivate/install/uninstall function of each plugin. The context contains a collection of scheduled tasks like clearCache or display message.
You can see the implementation here:
https://github.com/shopware/shopware/commit/b93312fa61005f080eb628f4e997097299a8ea5e

An example could looks like this:
<?php

namespace SwagTest;

use Shopware\Components\Plugin;
use Shopware\Components\Plugin\PluginContext;

class SwagTest extends Plugin
{
    public function install(PluginContext $context)
    {
        $context->scheduleClearCache(PluginContext::CACHE_LIST_DEFAULT);
    }

    public function activate(PluginContext $context)
    {
        $context->scheduleClearCache(PluginContext::CACHE_LIST_FRONTEND);
    }

    public function uninstall(PluginContext $context, $keepUserData)
    {
        parent::uninstall($context, $keepUserData);
    }
}

You can completely overwrite each function and handle the cache invalidation by your self, or you can call the parent function which clears in default the PluginContext::CACHE_LIST_DEFAULT cache list.


Epic: GitLab Merge Request Gating Tasks

Summary
Epic: GitLab Merge Request Gating Tasks
Background
Features, tasks, and bugs related to GitLab Merge Request Gating

Closing epic


[Automated] Update actions

Produced via:
# meta: knative/.github
# main: knative/operator
cp $(find "${GITHUB_WORKSPACE}/meta/workflow-templates" -type f -name '*.yaml') \
  "${GITHUB_WORKSPACE}/main/.github/workflows/"

Cron. -knative-prow-robot
/cc knative/operations-wg-leads
/assign knative/operations-wg-leads

/hold
I put these in on purpose because these files are synced from other releases

/hold
I put these in on purpose because these files are synced from other releases

@evankanderson Is there any way to keep this line, without automatic deletion?

@evankanderson Is there any way to keep this line, without automatic deletion?

That's what I'm going to look at today

That's what I'm going to look at today

It looks like this is https://github.com/wei/git-sync, so I'll probably need to update knative/.github

It looks like this is https://github.com/wei/git-sync, so I'll probably need to update knative/.github

/close

/close


Badges for dockerhub

Added a couple of nice badges for Docker Hub. Also slightly improve badges section.
Motivation and context

Recently we added images on dockerhub. It will be great to have links with some statistics as badges on our README.md page.
How has this been tested?

N/A
Checklist

[x] I submit my changes into the develop branch
[ ] I have added description of my changes into CHANGELOG file
[ ] I have updated the documentation accordingly
[ ] I have added tests to cover my changes
[ ] I have linked related issues (read github docs)
[ ] I have increased versions of npm packages if it is necessary (cvat-canvas,
cvat-core, cvat-data and cvat-ui)

License

[x] I submit my code changes under the same MIT License that covers the project.
Feel free to contact the maintainers if that's a concern.
[x] I have updated the license header for each file (see an example below)

# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

Coverage remained the same at 75.494% when pulling c5d2b648b278635a7752d12c4723235fed02346b on nm/dockerhub_badges into 8e1fe94602e1164333cee8ec8e9bbe3a9aa5760f on develop.


Add testing

Add testing to make merging process easier.

I forgot to say I was infinitely grateful for this project before complaining, so there, I said it :-)


How to use gnet with gobwas

The new version breaks the usual wrapping of conn.Read() to an io.Reader which is the only thing that gobwas upgrader supports. After experimenting a bit with custom codec I couldn't find a way to not reset the buffer in the decode function and not cause an endless loop. What is the best way to combine gnet with gobwas then in the new version or should I just use the old one?

Sorry, I'm not familiar with gobws, could you illustrate this issue with sample code?


Add forward and backward overlap icons

I'm not an artist in the slightest, but by using copy as a base, I was able to get these icons looking serviceable.
These icons may need to be measured in something more capable, since I used svgviewer, which doesn't have pixel measurement capabilities. It's also not the best for dimensional accuracy, as you can see from this screenshot.

Collapsible screenshot and svg code from svgviewer

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bring-to-front">
  <!--  Debug Border, remove before SVGOMG  -->
  <rect width="24" height="24" x="0" y="0" stroke-width="1" stroke="red" />

  <rect width="8" height="8" x="8" y="8" rx="2" ry="2"/>
  <path d="M 4 10 c -1 0 -2 -1 -2 -2 v -4 c 0 -1 1 -2 2 -2 h 4 c 1 0 2 1 2 2"/>
  <path d="M 14 20 c 0 1 1 2 2 2 h 4 c 1 0 2 -1 2 -2 v -4 c 0 -1 -1 -2 -2 -2"/>
</svg>

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send-to-back">
  <!--  Debug Border, remove before SVGOMG  -->
  <rect width="24" height="24" x="0" y="0" stroke-width="1" stroke="red" />

  <rect width="8" height="8" x="2" y="2" rx="2" ry="2" />
  <rect width="8" height="8" x="14" y="14" rx="2" ry="2" />
  <path d="M 7 14 v 1 c 0 1 1 2 2 2 h 1" />
  <path d="M 14 7 h 1 c 1 0 2 1 2 2 v 1" />
</svg>

<!-- Lucide copy icon for reference -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy">
  <!--  Debug Border  -->
  <rect width="24" height="24" x="0" y="0" stroke-width="1" stroke="red" />

  <rect width="14" height="14" x="8" y="8" rx="2" ry="2"/>
  <path d="M 4 16 c -1.1 0 -2 -.9 -2 -2 V 4 c 0 -1.1 .9 -2 2 -2 h 10 c 1.1 0 2 .9 2 2"/>
</svg>

When eyeballing the icons, the spacing looks the same as the copy icon, and so should be design guide compliant. That said, can someone please verify in something like Illustrator or another capable program?

Ooh, I didn't know about that workflow. The icon x-rays confirm that the spacing is within the design guide!

Is there anything left that needs tweaking? Or is this just waiting on a release candidate?


fxied #2132,#2137 - [closed]

In GitLab by @liyanq528 on Jun 26, 2019, 05:43
Merges issue#2137 -> dev

In GitLab by @wknet123 on Nov 13, 2019, 11:45
The test coverage for backend is 18.1%  38.48%  , check  console log

In GitLab by @wknet123 on Nov 13, 2019, 11:45
closed


fixes issue #156; #158

Fixes #156
Fixes #158
CALL streams.publish(a, b, c) returns its arguments when it is successful, allowing verification that the message was published, and chaining of arguments in cypher.

Achievement unlocked -- my first neo4j-streams PR and my first ever written line of Kotlin.  :)

Too many issues, aged out.


Update vscode version for Profiler extension

After bumping the version for Profiler extension, it still doesn't install because of vscode version.

Updating the version in this PR.

Tested this change with an adhoc build and the installation is turning out as expected. And "Open XEL" is working as anticipated.


[RESOLVED] Interface eth0(): High error rate (>2 for 5m)

Problem started at 10:48:29 on 2023.07.20
Problem name: Interface eth0(): High error rate (>2 for 5m)
Host: S100-Primario
Severity: Warning
Operational data: errors in: 1, errors out: 0
Original problem ID: 32877
Event details in Zabbix: http://<IP_ADDRESS>/tr_events.php?triggerid=23483&eventid=32877

Problem has been resolved in 9m 0s at 10:57:29 on 2023.07.20
Problem name: Interface eth0(): High error rate (>2 for 5m)
Host: S100-Primario
Severity: Warning
Original problem ID: 32877


OneShot: allow passing a file

I'd like to query chatGPT and to upload, after my query, a PDF file as part of the request. Do the API allow this? can you maybe add another script for the purpose?
Like:
-> please find in the following PDF I'm uploading all occurrences of the following concept, and point me to the pages and lines where they appear. Concept: xxxx. [upload the file]
Thanks

I asked ChatGPT.
He provided a modified script first, improving yours by correcting a typo (userInput vs UserInput) and by adding try/catch.
# Function to send a message to ChatGPT
function Invoke-ChatGPT ($message) {
    try {
        ...
    } catch {
        Write-Error "An error occurred: $_"
        return "An error occurred while trying to communicate with the AI. Please check your API key and connection."
    }
}

however it states that gpt-3.5-turbo does not allow file upload. gpt-4o does.
Suggestions:
$file = client.files.create(
  file=open("myfile.pdf", "rb"),
  purpose="assistant"
)

and then
$response = client.messages.create(
  thread_id=thread.id,
  role="user",
  content="Can you summarize the content of this file?",
  file_ids=[file.id]
)

Honestly I haven't tried it yet, I just asked ChatGPt out of curiosity. I'll try another day but maybe this speeds up your task, if you are interested in providing a gpt-4o script with file upload.

I realised now that for API use a separate billing is needed. I won't be able to test it. I provide the version adapted to Asistant API.
<#
This script will operate on text and PDF files.
#>

# Parse command-line arguments
param (
    [Parameter(Mandatory=$true)][string]$pdfPath
)

# Define API key and endpoint
$ApiKey = "api_key"
$ApiUploadEndpoint = "https://api.openai.com/v1/files"
$ApiAssistantEndpoint = "https://api.openai.com/v1/assistants/{assistant_id}/messages"

<#
System message.
You can use this to give the AI instructions on what to do, how to act, or how to respond to future prompts.
#>
$AiSystemMessage = "This is my request. Do something with the attached PDF file."

# Function to upload the PDF to OpenAI
function Upload-PDF ($pdfPath) {
    try {
        # Ensure the PDF exists
        if (-not (Test-Path $pdfPath)) {
            throw "The specified PDF file does not exist."
        }

        # Upload the PDF file
        $headers = @{
            "Authorization" = "Bearer $ApiKey"
        }
        $fileContent = [System.IO.File]::ReadAllBytes($pdfPath)
		$formData = @{
			file = @{
				value = $fileContent
				filename = [System.IO.Path]::GetFileName($pdfPath)
				contentType = 'application/pdf'
			}
			purpose = "assistant"
		}

        $response = Invoke-RestMethod -Method POST -Uri $ApiUploadEndpoint -Headers $headers -Form $formData

        # Return the file_id of the uploaded PDF
        return $response.id
    } catch {
        Write-Error "Failed to upload PDF: $_.Exception.Message"
        return $null
    }
}

# Function to send a message to GPT-4o Assistant API
function Invoke-AssistantGPT ($message, $fileId) {
    try {
        # Set the request headers
        $headers = @{
            "Content-Type"  = "application/json"
            "Authorization" = "Bearer $ApiKey"
        }

        # Set the request body
		$requestBody = @{
			"messages" = @(
				@{
					"role"    = "system"
					"content" = $AiSystemMessage
				},
				@{
					"role"    = "user"
					"content" = $message
					"file_ids" = @($fileId)
				}
			)
			"max_tokens" = 2000
			"temperature" = 0.5
		}

        # Send the request to the Assistant API
        $response = Invoke-RestMethod -Method POST -Uri $ApiAssistantEndpoint -Headers $headers -Body (ConvertTo-Json $requestBody)

        # Return the Assistant's response
        return $response.choices[0].message.content
    } catch {
        Write-Error "Error in communication with GPT-4o: $_"
        return "An error occurred while querying the Assistant."
    }
}

# Ensure a PDF path was provided
if (-not $pdfPath) {
    Write-Host "No PDF file path provided. Please provide a valid PDF file path with the -pdf parameter."
    exit
}

# Upload the PDF to OpenAI
$fileId = Upload-PDF $pdfPath

# Ensure the PDF was uploaded successfully
if (-not $fileId) {
    Write-Host "Failed to upload the PDF file."
    exit
}

# Get user input for the email draft
$userInput = Read-Host "Rough email draft or message"

# Ensure user input isn't empty
if ([string]::IsNullOrWhiteSpace($userInput)) {
    Write-Host "Input cannot be empty. Please provide a message."
    exit
}

# Query GPT-4o Assistant with the email draft and uploaded PDF
$AiResponse = Invoke-AssistantGPT $userInput, $fileId

# Show response
Write-Output "`nResponse from GPT-4o:`n"
Write-Output $AiResponse

Read-Host "Press enter to Exit..."

Good luck to anyone interested in testing or developing it further.


404 Error from Azure API from version 7.3.0

Describe the bug
From the version 7.3.0, Faraday::ResourceNotFound: the server responded with status 404 occurs when calling #embeddings method to send a request to Azure.
To Reproduce
Steps to reproduce the behavior:

Configure to use Azure OpenAI

OpenAI.configure do |config|
  config.access_token = ENV.fetch("AZURE_OPENAI_API_ACCESS_TOKEN", "")
  config.uri_base = ENV.fetch("AZURE_OPENAI_API_URI_BASE", "")
  config.api_type = :azure
  config.api_version = ENV.fetch("AZURE_OPENAI_API_VERSION", "")
  config.request_timeout = 60
end

Call #embeddings

> client = OpenAI::Client.new
> client.embeddings(parameters: {model: "text-embedding-3-small", input: "test-input"})

See error

Faraday::ResourceNotFound: the server responded with status 404
from /Users/your-name/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/faraday-1.10.4/lib/faraday/response/raise_error.rb:22:in `on_complete'

I have confirmed that it works on the version 7.2.0
Expected behavior
No errors occurred
Screenshots
N/A
Desktop :

OS: macOS (Sonoma 14.6.1)
Browser: N/A
Version: N/A

Possible solution
Maybe the following change might be the cause:
https://github.com/alexrudall/ruby-openai/pull/527
https://github.com/alexrudall/ruby-openai/blob/a5714d340c254b810abff11d8fdc2e49d703fa14/lib/openai/http.rb#L21-L26
https://github.com/alexrudall/ruby-openai/blob/a5714d340c254b810abff11d8fdc2e49d703fa14/lib/openai/http.rb#L88-L91
If we use Azure, req.params already has the api_key param. So should we merge query_params instead of overwriting ?

Hi @ymtdzzz, thank you for the clearly specified issue and apologies for any inconvenience. Would you be able to test if #532 does indeed fix the issue? Thank you.

@alexrudall , thanks for your rapid response!
#532 seems to fix this issue :+1:
[3] pry(main)> OpenAI::VERSION
=> "7.3.1"
[4] pry(main)> response = client.embeddings(parameters: {model: "text-embedding-3-small", input: "test-input"})
[5] pry(main)> response.dig("data", 0, "embedding").length
=> 1536

@alexrudall , thanks for your rapid response! #532 seems to fix this issue 👍
[3] pry(main)> OpenAI::VERSION
=> "7.3.1"
[4] pry(main)> response = client.embeddings(parameters: {model: "text-embedding-3-small", input: "test-input"})
[5] pry(main)> response.dig("data", 0, "embedding").length
=> 1536

Thank you @ymtdzzz, v7.3.1 is now released and contains the fix.

Thanks! This issue is fixed so I close it.


Remove duplicate 5.2.3 docs link and upkeep of v6 patch docs links

Description:
There is a duplicate link for 5.2.3 in DocumentationVersions.md, which displays in the live documentation as:

5.2.3
5.2.3

Second,DocumentationVersions.md is missing links to 6.0.1, 6.0.2, 6.0.4 patch versions. Not sure if this was intentional, but it might be nice to put those here for archival reasons since they're in gh-pages anyway, up to you. Let me know what you think about this.
Lastly, there's a big line break jump between version 6 documentations & the version below it, which cause some fragmented formatting starting at v6.0.0-alpha-4 (https://github.com/kevinzwh/redux-form/blob/master/docs/DocumentationVersions.md)
Changes proposed:

Removed duplicate 5.2.3 version link
Add missing documentation links to 6.0.1, 6.0.2, 6.0.4
Prune extra line breaks from DocumentationVersions.md

Current coverage is 100% (diff: 100%)

Merging #1793 into master will not change coverage

@@           master   #1793   diff @@
=====================================
  Files          53      53
  Lines        1143    1143
  Methods         0       0
  Messages        0       0
  Branches        0       0
=====================================
  Hits         1143    1143
  Misses          0       0
  Partials        0       0

Powered by Codecov. Last update 4babf1b...0897397


(WIP) Implementing custom payload/merge hooks abstractions for application specific merge logic

Tested with unit tests, trying to test with an ingestion job, initial feedback will be helpful.

Updated the PR, @vinothchandar please take another pass.

Incorporated changes, one observation. I noticed that we have a mix of 2 spaces and 4 spaces in many classes. According to the developer docs, I think you guys chose to have 2 spaces : https://google.github.io/styleguide/javaguide.html#s4.2-block-indentation. The problem I noticed is that my Intellij defaults to a profile with 4 spaces. I noticed that the classes under hoodie-spark also have 4 spaces which might mean your IDE defaults to something similar. I'll fix my IDE to make sure I follow 2 spaces.

thanks for pointing out. yes, i have been meaning to format the whole project once and set/enforce uniformity..  In any case, I generally use the rule of thumb that commits dont introduce whitespace only changes :)


fc.util.extent.include now accepts an array of values. Also updated t…

Closes #911.

This LGTM - @chrisprice are you happy to merge?

Thanks @jdhodges

Just realised, this PR did not include the website changes. @jdhodges - any chance you could make he minor tweaks required to this page:
https://d3fc.io/components/util/extent.html


"build constraints exclude all Go files in" when trying to import golang.org/x/sys/unix

What exactly did you do? Did you specify GOOS=js and GOARCH=wasm?
Originally posted by @neelance in https://github.com/golang/go/issues/26598#issuecomment-407818226
I saw this answer in an old issue but did not understand why this needs to be done

Please fill in the entire issue template you see when creating a new issue. What exactly are you trying to do? And what exactly is your build environment? (Output from the command go env)
Setting GOOS and/or GOARCH means you are cross compiling. golang.org/x/sys/unix as the name suggest, is a unix package and thus is only for Linux/OSX and other unix based operating systems. Your issue title suggest you are on windows, in which case you cannot use this package.

If you do not specify GOOS and GOARCH, the build constraints won't pick up the right files for that target. Please see https://golang.org/pkg/go/build/#hdr-Build_Constraints.
For further questions, please feel free to take a look at the Questions wiki page; it has a list of good places for asking questions.


Operator creation failing with a 404-NotAuthorizedOrNotFound error

Description
This error is happening when using the operator volume encryption parameter because of a missing policy.
Output
│ Error: 404-NotAuthorizedOrNotFound
│ Provider version: 4.64.0, released on 2022-02-16.
│ Service: Core Instance
│ Error Message: Authorization failed or requested resource not found.
│ OPC request ID: d93785fe8d577aa1876a544280788333/FF36F2D6516F4FA35455B538A7D15BE0/69F0F83C2B314D92CC361DF8FDC130A1
│ Suggestion: Either the resource has been deleted or service Core Instance need policy to access this resource. Policy reference: https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/policyreference.htm
│
│
│   with module.oci_oke.module.operator[0].oci_core_instance.operator,
│   on .terraform/modules/oci_oke.operator/compute.tf line 4, in resource "oci_core_instance" "operator":
│    4: resource "oci_core_instance" "operator" {
│

Expected output
Operator should get created without any errors
Steps to reproduce
Use the operator module with the following parameter
boot_volume_encryption_key = <kms key ocid>

Closed due to lack of activity


Adding support for DataTables native column search functionality

Hi,
I basically followed your line of thought in #2
I put the DT-search in a different loop in order to be able to fully support the regex capabilities of datatables.
I tested it and the behavior is as expected:

If there is a DT-column search

filter after that

If there is a global search column filter

filter after that

if there are both kind of filters

use global search

Looks great @reinoldus.  Thank you!


TOURS

Adding a tours project using react for tours of a tour and travel company which is using an api it is fetching data . add having a delete option

program name?

Codepeak 2023