chore: release

🤖 New release

rustsat: 0.4.3 -> 0.4.4 (✓ API compatible changes)
rustsat-minisat: 0.2.4 -> 0.3.0 (⚠ API breaking changes)
rustsat-tools: 0.2.4 -> 0.2.5 (✓ API compatible changes)
rustsat-cadical: 0.2.4 -> 0.2.5 (✓ API compatible changes)
rustsat-kissat: 0.1.6 -> 0.1.7 (✓ API compatible changes)
rustsat-glucose: 0.2.4 -> 0.3.0 (⚠ API breaking changes)

⚠ rustsat-minisat breaking changes
--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.30.0/src/lints/inherent_method_missing.ron

Failed in:
  Minisat::freeze_lit, previously in file /tmp/.tmpPwyLSW/rustsat-minisat/src/simp.rs:79
  Minisat::melt_lit, previously in file /tmp/.tmpPwyLSW/rustsat-minisat/src/simp.rs:84

⚠ rustsat-glucose breaking changes
--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.30.0/src/lints/inherent_method_missing.ron

Failed in:
  Glucose::freeze_lit, previously in file /tmp/.tmpPwyLSW/rustsat-glucose/src/simp.rs:79
  Glucose::melt_lit, previously in file /tmp/.tmpPwyLSW/rustsat-glucose/src/simp.rs:84

Changelog
rustsat

[0.4.4] - 2024-03-28
Bug Fixes

Incorrect coarse_ub in dpw when unweighted
Dpw edge cases with < 2 inputs

Documentation

Clarify lit rep and relation to IPASIR/DIMACS

Features

Migrate error handling to anyhow create
Move ipasir bindings to separate crate

Refactor

Clean up control flow in solver methods
Clean up control flow in dimacs parsing

rustsat-minisat

[0.3.0] - 2024-03-28
Bug Fixes

Variable freezing and return val for var_eliminated

Features

quiet feature to disable stdout printing
Migrate error handling to anyhow create
FreezeVar trait for Glucose and Minisat
Return error when assumption is eliminated

Refactor

Clean up control flow in solver methods

rustsat-tools

[0.2.4] - 2024-02-22
Features

Make opb defaults more like pbo competition specs

rustsat-cadical

[0.2.5] - 2024-03-28
Features

Cadical version 1.9.5
Migrate error handling to anyhow create
Exclude ipasir.cpp to avoid conflicts with other linked ipasir libs
FreezeVar trait for Glucose and Minisat

Refactor

Clean up control flow in solver methods

rustsat-kissat

[0.1.7] - 2024-03-28
Features

Migrate error handling to anyhow create

Refactor

Clean up control flow in solver methods

rustsat-glucose

[0.3.0] - 2024-03-28
Bug Fixes

Variable freezing and return val for var_eliminated

Features

quiet feature to disable stdout printing
Migrate error handling to anyhow create
FreezeVar trait for Glucose and Minisat
Return error when assumption is eliminated

Refactor

Clean up control flow in solver methods

This PR was generated with release-plz.

Remember to revert ignoring the ipasir package before merging this.

Before release checklist:

[ ] Change versioning to be major version bump
[ ] Double check that C-API and Python-API version checks actually work
[ ] Revert ignoring IPASIR package in release CLI


Docs: Update license

Main changes
Updated license references to MIT
Context
Related https://github.com/onebeyond/admin/issues/27

I could try to have a look at these tests to make the CI pass.

@UlisesGascon, as the component is implemented, we might need to create some topics in our Azure instance in order to make the tests pass again.


Cross compile to SBT {0.13.16, 1.0.1}

https://github.com/47deg/sbt-org-policies/pull/510/files#diff-a84f91f20f040218bccd09fed4761fb3R5 and https://github.com/47deg/sbt-org-policies/pull/510/files#diff-4198f89a479a3a8c2b310affc814c14fR127 took me the longest time to figure out.
First link: I didn't notice the difference of % and %% for a long time.

scripted-plugin : 0.13.16 exists for scala-2.10
scripted-plugin_2.12 : 1.0.1 exists for scala-2.12

How I found out the second link was possible https://github.com/sbt/sbt/issues/3473#issuecomment-325729747.

@fedefernandez Can you look this PR over also?


Initial sample

Purpose

Adding samples c1s1: sign-in, c1s2: sign-in-b2c and c2s1: call-graph

Does this introduce a breaking change?

[ ] Yes
[ x ] No

Pull Request Type
What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ x ] Other... Please describe: **new sample**

How to Test

Get the code

git clone https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial.git
cd ms-identity-javascript-angular-tutorial
git checkout dev
cd [sample folder where package.json is]
npm install

Test the code

What to Check
Verify that the following are valid:

Run in Chrome, Edge or Firefox
Run in private mode

Other Information

For chapter 3.2 (call api, b2c) since we have all the registration done for the user already, we can move the app registration steps to an expandable section.


Search Cost

Hi!
Could you tell me the search cost on different tasks?

wondering too

wondering too


Support single sided space insertion

In the previous commit I only considered non-CJK chars surrounded by CJK chars, but there is such situation where the char is adjacent to CJK chars in only one side.
Fix this issue.

You can create a new branch based on upstream master to send a pull request. The commit log could be better without "Merge branch 'master'".

Thanks for your quick merge and kindly advice


Update 05_pytorch_going_modular.md

at the return self.classifier(self.block_2(self.block_1(x)))
You called the blocks conv_block_1 and conv_block_2. Hence the return function leveraging the benefits of operator fusion errors when running a forward pass.  I fixed this by changing the two block names to the correct ones in return.
It is also possible to rename both blocks to the shorter version of block_1 and block_2 respectively.

Thank you for the fix!


feat: add Proxy for linux

https://webkitgtk.org/reference/webkit2gtk/stable/WebKitNetworkProxySettings.html
test code:
package main

import (
	"github.com/webview/webview"
)

func main() {
	w := webview.New(true)
	defer w.Destroy()

	w.SetTitle("ProxyTest")
	w.SetSize(800, 600, webview.HintNone)
	//w.Proxy("http://<IP_ADDRESS>:8118", nil)
	//w.Proxy("http://<IP_ADDRESS>:8118", []string{"whatismyipaddress.com"})
	//w.Proxy("socks://<IP_ADDRESS>:7777", nil)
	w.Proxy("socks://<IP_ADDRESS>:7777", []string{"whatismyipaddress.com"})
	w.Navigate("https://whatismyipaddress.com/")
	w.Run()
}

But doesn't webkit use http_proxy environment variable to configure the proxy? Does this really need to be an additional API to the library?

Just support ignore hosts, if you think it's useless, let's just close this.

I might be wrong but I struggle to make this work with this PR built-in or with the HTTP{S}_PROXY variable set. Is this for sure works? Did anybody tested it?

I had success make proxy working add this
static char *var = "HTTP_PROXY=http://<IP_ADDRESS>:112";

This does not look like golang syntax. I suspect you use your own js payload into webview. Im interested in a more global webview model, where you can set proxy for all content handled by webview


update helm package

Signed-off-by: Sherin Varughese<EMAIL_ADDRESS>Related Issue: https://issues.redhat.com/browse/ACM-2461
Description of changes

/cherry-pick release-2.6


initializeModel issues false warning about RHSonly variable not initialized

a0[n,1:3]~dmnorm(Nmu[1:3],Nomega[1:3,1:3])
lambda[n,1:3] <- exp(a0[n,1:3])

Can you show the full call to nimbleModel()?

This is simplified from code from a user who emailed me.  I think the
problem occurs when a node defined on LHS as a vector is split up (used as
scalars) on the RHS.  This is valid but the resulting RHS nodes are counted
as RHS-only, triggering the problem.  So it is not necessarily a bug in the
initializeModel nimbleFunction, just triggered there.  And the mcmc
continues to run ok, but it has issued an unnecessary warning.
reduced case
code <- nimbleCode({
for (n in 1:N){
a0[n,1:3]~dmnorm(mu[1:3],Sigma[1:3,1:3])
lambda[n,1:3] <- exp(a0[n,1:3]) ## alternative, which shifts the
problem to lambda
for (k in 1:K){
lambda[n,k] <- exp(a0[n,k])
y[n,k]~dpois(lambda[n,k])
}
}
})
m <- nimbleModel(code, constants=list(N = 3, K = 3), inits = list(mu =
rep(0,3), Sigma = diag(3)), data = list(y = matrix(rpois(9, 3), nrow =3)))
cm <- compileNimble(m)
Rmcmc <- buildMCMC(m)
Cmcmc <- compileNimble(Rmcmc, project = m)
Rmcmc$run(1)
Cmcmc$run(1)
problem may be that lambda elements should not appear here:
m$modelDef$maps$nodeNamesRHSonly
On Thu, Jan 14, 2016 at 4:50 PM, Christopher Paciorek <
<EMAIL_ADDRESS>wrote:

Can you show the full call to nimbleModel()?
—
Reply to this email directly or view it on GitHub
https://github.com/nimble-dev/nimble/issues/107#issuecomment-171831664.

Not entirely sure if this is on me, but I'll look into it tomorrow.
Daniel
On Thu, Jan 14, 2016 at 5:08 PM, slope<EMAIL_ADDRESS>wrote:

This is simplified from code from a user who emailed me. I think the
problem occurs when a node defined on LHS as a vector is split up (used as
scalars) on the RHS. This is valid but the resulting RHS nodes are counted
as RHS-only, triggering the problem. So it is not necessarily a bug in the
initializeModel nimbleFunction, just triggered there. And the mcmc
continues to run ok, but it has issued an unnecessary warning.
reduced case
code <- nimbleCode({
for (n in 1:N){
a0[n,1:3]~dmnorm(mu[1:3],Sigma[1:3,1:3])
lambda[n,1:3] <- exp(a0[n,1:3]) ## alternative, which shifts the
problem to lambda
for (k in 1:K){
lambda[n,k] <- exp(a0[n,k])
y[n,k]~dpois(lambda[n,k])
}
}
})
m <- nimbleModel(code, constants=list(N = 3, K = 3), inits = list(mu =
rep(0,3), Sigma = diag(3)), data = list(y = matrix(rpois(9, 3), nrow =3)))
cm <- compileNimble(m)
Rmcmc <- buildMCMC(m)
Cmcmc <- compileNimble(Rmcmc, project = m)
Rmcmc$run(1)
Cmcmc$run(1)
problem may be that lambda elements should not appear here:
m$modelDef$maps$nodeNamesRHSonly
On Thu, Jan 14, 2016 at 4:50 PM, Christopher Paciorek <
<EMAIL_ADDRESS>wrote:

Can you show the full call to nimbleModel()?
—
Reply to this email directly or view it on GitHub
<https://github.com/nimble-dev/nimble/issues/107#issuecomment-171831664
.

—
Reply to this email directly or view it on GitHub
https://github.com/nimble-dev/nimble/issues/107#issuecomment-171834293.

The error occurs on line 1718 of BUGS_modelDef.R.
The fix is straightforward, but if I fix it I'm sure I would be re-inventing machinery (essentially for expanding node names such as "a[1:3]" into "a[1]", "a[2]", "a[3]") that already exists.
Perry, I think you're closest with this section of the code, by far.

I fixed this.  It turned out all the right information was being set up during model processing.  model$getNodeNames(includeRHSonly=TRUE) compared to model$getNodeNames() revealed that the correct information about what is a RHSonly node exists.  It turned out the information being populated into maps$nodeNamesRHSonly was out of date.  I replaced how that is populated.


Motherduck Data Connector

Goal-State/What/Result
Spice OSS users can access motherduck tables through the Spice runtime.
Milestones:

M1: Implement core MotherDuck Connector.
M2: Support secret read / write for Mother Duck token.
M3: Pass E2E test For Mother Duck Connector.
M4: Documentations & Customer Notified.

Why/Purpose
Adding support for motherDuck: the duck-db powered server less data warehouse will attract the broad duck-db communities.  This will help enhance our position as a leading cloud-warehouse.
OKR:

O: Spice.ai OSS is recognized and used as a competitive open-source interface to the leading cloud data warehouses for data applications · Issue #163 · spicehq/team (github.com)

By When
A target date for done-done completion of the entire enhancement.
Issue/Spec written and reviewed: April 9th
M1: April 10th
M2:
...
Done-Done: April 15th
Done-Done

[x] The Algorithm
[x] First-Principles Driven
[x] Issue reviewed by PM (Luke or Aurash)
[ ] Threat Model / Security Review
[ ] Tests (if applicable)
[ ] Dev

[ ] Tested
[ ] Qualitative & Performative Observability (Metrics & Dashboards)
[ ] Alerting

[ ] Prod (AWS)

[ ] Tested
[ ] Qualitative & Performative Observability (Metrics & Dashboards) always required
[ ] Alerting

[ ] Prod (Teraswitch)

[ ] Tested
[ ] Qualitative & Performative Observability (Metrics & Dashboards) always required
[ ] Alerting

[ ] Documentation
[ ] Customers notified (if applicable)

Spec
Overview
Motherduck data connector can be viewed as a DuckDB connector with DuckDB attached to motherduck.
User configuration in spicepod.yaml spec
from: md:my_database.my_dataset
name: my_dataset
description: dataset from motherduck
param:
  mode: file
  duckdb_file: /my/chosen/location/duckdb.db

User provision of duckdb service token
spice login motherduck \
    --token $MOTHERDUCK_SERVICE_TOKEN \

How/MAP

Initiate connection pool to duckdb in DataConnectorFactory
Attach Motherduck to duckdb in DataConnectorFactory by running .open "md:?motherduck_token=<motherduck_token>", if MotherDuck Service Token is found in secret.
Querying motherduck through querying duckdb.,

The Algorithm

[x] Every requirement questioned?

[x] Duckdb rust library might not support attachment to MotherDuck
[x] Should MotherDuck connector be optional when runtime starts?
[x] How to shut down MotherDuck connection when not needed.

[x] Delete (Scope) any part you can.

[x] Duckdb connector, which could be relevant, should be supported in a separate enhancement ticket in the future

[x] Simplify.
[x] Break down into smaller iterations/milestones.
[x] Opportunities for automatatin.

Implementation
QA

I'm not sure the mode: file makes sense in this case.  There isn't any other option for their data connector.  We'll just have data file based data connectors.


Add HTML version of "Using Swift with Cocoa and Objective-C"

There is already a link to the iBook version of the book, but the HTML version is more useful if you want to read it without iTunes or an iOS device.

Thanks!
Please use the format described at the end of this section.

I've updated the formatting for both books in the Swift section. Sorry about that!

Thanks!


Fixed typographical error, changed aquire to acquire in README.

@patriksimek, I've corrected a typographical error in the documentation of the node-mssql project. You should be able to merge this pull request automatically. However, if this was intentional or if you enjoy living in linguistic squalor, please let me know and create an issue on my home repository.

Thanks.


Invalid constructor matcher order result in invalid instruction execution.

Instruction ARM6_be vldmia r12!,{d8,d9,d10,d11,d12,d13,d14,d15} (bytecode \xEC\xBC\x8B\x10 ) is being parsed/executed as ldc p11,cr8,[r12],#0x40".
That happen because the bytecode is being matched against ldc before vldmia, although vldmia comes first on the slaspec file and ldc don't contains the vldmia pattern bits.
I was not able to understand why that happen yet, I'll investigate later. First i need to learn how this graphical ordering process of sort_overlaps works.
Here a comparison of Sleigh-rs and Icicle-emu. Note that icicle branch the pattern for each | in the patter, sleigh-rs unify them.
Constraint in sleigh-rs in order they are checked:

inst
location
context
token

vldmia
ARMneon:3443
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1
0011XXXXXXXX1XX11101XXXX0XXXXXXX

vldmia
ARMneon:3700
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1
0011XXXXXXXX1XX10101XXXXXXXXXXXX

ldc
ARMInstructions:2709
0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX11
X011XXXXXXXX1X0XXXXXXXXXXXXXXXXX

ldc
ARMTHUMB:1904
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1
X0110111XXXX1X0XXXXXXXXXXXXXXXXX

Constraint in icicle  in order they are checked.

inst
location
context
token

vldmia
ARMneon:3700
0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX11
0011XXXXXXXX1XX10101XXXXXXXXXXXX

ldc
ARMInstructions:2709
0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX11
X011XXXXXXXX1X0XXXXXXXXXXXXXXXXX

vldmia
ARMneon:3700
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1
00110111XXXX1XX10101XXXXXXXXXXXX

vldmia
ARMneon:3443
0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1
0011XXXXXXXX1XX11101XXXX0XXXXXXX

vldmia
ARMneon:3443
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1
00110111XXXX1XX11101XXXX0XXXXXXX

ldc
ARMTHUMB:1904
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1
X0110111XXXX1X0XXXXXXXXXXXXXXXXX

Turns out, it had nothing to do with petgraph, if was just a mistake in the match statement that unified multiple ordering results.
Fixed with: https://github.com/icicle-emu/icicle-emu/pull/23

There was a reason for the logic before (although I agree it is not likely not correct), the reason the logic was written was to handle a strange case I observed in the x64 specification. The problematic lines occur here: https://github.com/NationalSecurityAgency/ghidra/blob/9ec89c37fb30d6228ed82d4cf1441b7a7aa0a3f1/Ghidra/Processors/x86/data/languages/ia.sinc#L743C1-L746
Which correspond to the following:
(743)addr64: [Base64]      is mod=0 & r_m=4; rexXprefix=0 & index64=4    & Base64
(745)addr64: [Index64*ss]  is mod=0 & r_m=4;                Index64      & base64=5 & ss ; imm32=0
(756)addr64: [simm32_64]   is mod=0 & r_m=4; rexXprefix=0 & index64=4    & base64=5      ; simm32_64

With the corrected ordering results we get

756 should be matched before 743: has strictly has more bits set.
743 should be matched before 745: different bits are constrained and it is ordered first.
745 should be matched before 756: different bits are constrained and it is ordered first.

This leads to an ordering cycle:
756 ---> 743 ---> 745 ---> 756.
I'm not sure what I'm missing, that allows this cycle to be resolved, so for now the approach I used in 75f0259 was to use a heuristic that prefers that are in a cycle because they have more constraints, over constructors that are in the cycle because of ordering reasons. This seemed to work for all the ordering issues I know about -- but there could be some more cases I am missing.

I'm pretty sure the cycle is caused by this None using the file declaration order to affect the graph.
I think is possible to revert https://github.com/icicle-emu/icicle-emu/commit/75f0259dfb264e3ffd7d2ecd1f9ede3a9a65d9d9 and make this cycle to be unreachable.


Minor changes before the Aalto workshop

Work in progress. I will inform once ready to merge. Feel free to comment or ignore.

Ready to go.


Styling of upload Resume button is messed up

Can we shelve this then? @pierreTklein

Depends on what design thinks we should do for the choose file btn-- @ailishm @krubenok @loreina

I can tackle this to match our other buttons for the next milestone

Alright. I updated the information accordingly, then.

There also still seems to be an issue with the Asterix for required not appearing.


[MWPW-134319] branch link standardization update

Resolves: MWPW-134319
Adding q, category, searchCategory to search branch links
Test URLs:

Before: https://main--express--adobecom.hlx.page/express/create/flyer?lighthouse=on
After: https://mwpw-134319--express--adobecom.hlx.page/express/create/flyer?lighthouse=on

Codecov Report

Merging #121 (64ff37b) into stage (a48eab9) will decrease coverage by 4.88%.
Report is 5 commits behind head on stage.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##            stage     #121      +/-   ##
==========================================
- Coverage   39.20%   34.33%   -4.88%
==========================================
  Files           9       24      +15
  Lines        5009     9295    +4286
==========================================
+ Hits         1964     3191    +1227
- Misses       3045     6104    +3059

Files Changed
Coverage Δ

express/scripts/scripts.js
44.33% <0.00%> (-0.05%)
:arrow_down:

... and 15 files with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Fix a class loader leak in ForkJoinPool

Motivation:
As reported in #4211, when using Netty in Tomcat (or other container based deployment), ForkJoinPool leaks an instance of Submitter so that the class loader of Submitter won't be GCed. However, since Submitter is just a wrapper of int, we can replace it with int[1].
Modifications:
Replace Submitter with int[1].
Result:
No class loader leak in ForkJoinPool when using in a container.

Cherry-picked into 4.0 (28bc1070e7f89021fc6afa96b0c79c33353810cf) and 4.1 (55dd7d035fad00ef8681b0007eade6232f832e3a)

@windie thanks!


Fix "Array.concat not a function issue"

Replaces 3 calls to Array.concat with Array.prototype.concat.

Hi Adam, thanks for opening this PR fix!  I've merged glortho's fix in https://github.com/mgsloan/todoist-shortcuts/pull/73 since it's a little more concise.


Doesn't work (with Azure AD)

This PowerShell script either just doesn't work or doesn't work with PCs connected to Azure AD. Can someone verify that it works with Azure AD connected PCs?

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 3a21a400-6ad2-b371-0205-9a1b51b3fe29
Version Independent ID: 801d184f-046b-8d37-30f7-f82ebda3df3f
Content: Silently configure user accounts
Content Source: OneDrive/use-silent-account-configuration.md
Service: one-drive
GitHub Login: @kaarins
Microsoft Alias: kaarins

@JoanneHendrickson Any updates on this? Thanks!

@kaarins Any update?

Hello @JasonTimmins how are you? Wanted to know if you also apply registry keys and directions on this article
I assume also that MFA isn't enabled for your devices as per the article says.
Thanks

@JasonTimmins We appreciate any feedback that improves the content in the Microsoft docs but we haven't had any response from you so we are going to close this issue.

Please feel free to re-open this issue if there is a specific area of the docs that we can improve or make better. Thank you.

@officedocsbot close


Code cleanup

Application of IntelliJ suggestions and a bit of refactoring

The PR is closed because it will take a long time to test all the changes, so it hanging in Drafts for months is not good.


Work in Progress: Feature/fontend-styling (When all pages complete then merge to master)

changes for:
neue layout navbar
confirmation modal
create/edit page
delete footer


[flutter_tools] new version of package:flutter_plugin_android_lifecycle breaks flutter/flutter tests

See pub autoroll: https://github.com/flutter/flutter/pull/121847
I believe this is the change that broke framework tests: https://github.com/flutter/packages/pull/3271/files#diff-a7a667ae2f4a6b9d0a2fc91cc1eb18310cf7bc98cecbcd9b27fe444028d87887R37

nvm, closing in favor of https://github.com/flutter/flutter/issues/122039


Fix MCQ Questions not showing up

Features

MCQ Questions now show up
The enum QuestionTypes has been defined
There are tests for Assessment

Caveat

mount does not work for testing Assessment, as I encounter an error when rendering Workspace (right when the render method begins).

Pull Request Test Coverage Report for Build 117

7 of 7 (100.0%)  changed or added relevant lines in 3 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.7%) to 30.988%

Totals

Change from base Build 113:
0.7%

Covered Lines:
1110

Relevant Lines:
3181

💛  - Coveralls


supported a loaded df

Please add support for a loaded df, as there are lots of option for loading a csv, the current pandas_ui() does not accept any other argument.

for my case, I need to specify the separtor

Noted. Thanks for your suggestion will include accepting DF instead of CSV files in the very next release.


feat: Log-derivative based generic permutations for AVM

Introduces a relation for constructing generic permutations that needs to be templated for PIL for AVM.
Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

[ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
[ ] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
[ ] Every change is related to the PR description.
[ ] I have linked this pull request to relevant issues (if any exist).

Benchmark results
Metrics with a significant change:

circuit_simulation_time_in_ms (private-kernel-init): 382 (-50%)
circuit_simulation_time_in_ms (base-rollup): 4,094 (+133%)
circuit_simulation_time_in_ms (public-kernel-private-input): 398 (-31%)
circuit_input_size_in_bytes (private-kernel-init): 43,077 (-30%)
circuit_input_size_in_bytes (private-kernel-inner): 64,484 (-21%)
circuit_input_size_in_bytes (public-kernel-private-input): 25,203 (-39%)
circuit_input_size_in_bytes (public-kernel-non-first-iteration): 25,245 (-39%)
circuit_output_size_in_bytes (private-kernel-ordering): 9,689 (+19%)
tx_size_in_bytes (0): 10,323 (+17%)
l2_block_building_time_in_ms (8): 28,952 (+40%)
l2_block_building_time_in_ms (32): 114,124 (+39%)
l2_block_building_time_in_ms (128): 455,777 (+39%)
l2_block_rollup_simulation_time_in_ms (8): 21,656 (+81%)
l2_block_rollup_simulation_time_in_ms (32): 85,447 (+80%)
l2_block_rollup_simulation_time_in_ms (128): 339,506 (+80%)
l2_block_public_tx_process_time_in_ms (8): 7,248 (-16%)
l2_block_public_tx_process_time_in_ms (32): 28,527 (-17%)
l2_block_public_tx_process_time_in_ms (128): 115,718 (-17%)
note_trial_decrypting_time_in_ms (8): 10.8 (+88%)
note_trial_decrypting_time_in_ms (32): 13.8 (-85%)

Detailed results
All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call  to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.
This benchmark source data is available in JSON format on S3 here.
Values are compared against data from master at commit 2001d474 and shown if the difference exceeds 1%.
L2 block published to L1
Each column represents the number of txs on an L2 block published to L1.

Metric
8 txs
32 txs
128 txs

l1_rollup_calldata_size_in_bytes
45,444
179,588
716,132

l1_rollup_calldata_gas
222,948
867,764
3,447,980

l1_rollup_execution_gas
842,035
3,594,872
22,203,349

l2_block_processing_time_in_ms
2,035
7,727
30,166

note_successful_decrypting_time_in_ms
306 (+2%)
902 (+2%)
3,204 (-1%)

note_trial_decrypting_time_in_ms
:warning: 10.8 (+88%)
:warning: 13.8 (-85%)
142 (+1%)

l2_block_building_time_in_ms
:warning: 28,952 (+40%)
:warning: 114,124 (+39%)
:warning: 455,777 (+39%)

l2_block_rollup_simulation_time_in_ms
:warning: 21,656 (+81%)
:warning: 85,447 (+80%)
:warning: 339,506 (+80%)

l2_block_public_tx_process_time_in_ms
:warning: 7,248 (-16%)
:warning: 28,527 (-17%)
:warning: 115,718 (-17%)

L2 chain processing
Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric
5 blocks
10 blocks

node_history_sync_time_in_ms
22,333 (+2%)
42,850 (+1%)

note_history_successful_decrypting_time_in_ms
2,123 (+4%)
3,989

note_history_trial_decrypting_time_in_ms
126
156 (+1%)

node_database_size_in_bytes
1,628,310
1,097,320

pxe_database_size_in_bytes
29,748
59,307

Circuits stats
Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit
circuit_simulation_time_in_ms
circuit_input_size_in_bytes
circuit_output_size_in_bytes

private-kernel-init
:warning: 382 (-50%)
:warning: 43,077 (-30%)
20,441 (+8%)

private-kernel-ordering
122 (-4%)
25,833 (+6%)
:warning: 9,689 (+19%)

base-rollup
:warning: 4,094 (+133%)
659,500
873

root-rollup
143 (-15%)
4,072
1,097

private-kernel-inner
790
:warning: 64,484 (-21%)
20,441 (+8%)

public-kernel-private-input
:warning: 398 (-31%)
:warning: 25,203 (-39%)
20,441 (+8%)

public-kernel-non-first-iteration
391 (-4%)
:warning: 25,245 (-39%)
20,441 (+8%)

merge-rollup
15.5 (+1%)
2,592
873

Miscellaneous
Transaction sizes based on how many contracts are deployed in the tx.

Metric
0 deployed contracts
1 deployed contracts

tx_size_in_bytes
:warning: 10,323 (+17%)
29,083 (+6%)


Readme and History Changes for V4.0.0-rc3 Release

Description

Update README.md
Update History.txt

Test Steps

Checklist:

[ ] I have tested my changes. No regression in existing tests.
[ ] I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

/bot run uncrusitfy

/bot run uncrustify


Gauges not working on iPhone 7

Please, check IoT Manager version (must be 1.5.5, build 105050)

solved


Test: sudo-prompt and keytar moved into the main process

Refs:

[ ] macOS @btholt
[ ] linux @connor4312
[ ] windows @ornellaalt

Complexity: 2
Create Issue

Test that:

you can save a file that needs elevated privileges (e.g. /etc/hosts) from the error notification that appears after trying to save normally
you can use the GH PR extension (i.e. login and your credentials work)
you do not see macOS keychain dialogs popping up repeatedly after confirming once with "Allow All"

I was unable to fully test today as a result of https://github.com/microsoft/vscode-pull-request-github/issues/2168

The PR extension only works with the nightly build on Insiders -- other verifies, make sure to use github.vscode-pull-request-github-insiders rather than the stable version.


Check extra image repo before start

JIRA: RHELWF-3065

@mprahl @qixiang please review

Comments resolved

Comments resolved

LGTM

Thank you. Could you please merge it, cause I don't have rights for it?


initialize：160 Error loading MathJax: TypeError: Cannot set property Package of # which has only a getter

import "mathjax-full/es5/tex-svg-full";

This is a duplicate of #3106, and the earlier #3079.
Because this is occurring while handling the MathJax configuration, we can't use the usual MathJax.startup.ready() function to fix it.  It is fixed in v4 (currently in beta release), but not in v3.
The fix is in this commit.  You could edit the ts/components/global.ts file to make the combineConfig() function be
https://github.com/mathjax/MathJax-src/blob/43bb7d905c1891f0fd3b5459dc0ec2f90c650845/ts/components/global.ts#L85-L102
and recompile it using npm run -s compile, then rebuild the tex-svg-full component using npm run -s make-components (which will rebuild everything, so it will take a while), that should allow it to work for you.
Sometimes the presence of a MathJax configuration can prevent this.  There is also some discussion in #3079 about it, but no other solution.


Trying to get property 'batch' of non-object in Repositories\MigrationRepository.php:53

I have 2 existing indexes in elastic search and i have written another migration for 3rd index then it give me the below error when i am trying to run the "php artisan elastic:migrate"
Trying to get property 'batch' of non-object in Repositories\MigrationRepository.php:53
When i try to debug it the i found.....
$record = $this->table()
->select('batch')
->orderBy('batch', 'desc')
->first();
return isset($record) ? (int)$record->batch : null;
   Here "$record" variable contain the array not the object. I am using mongoDB as primary database
   Please fix this issue asap and let me know if you need any further information about this issue

Hi @vishaltomar76, what library do you use for MongoDB? According to the Laravel first method definition, it shouldn't return an array:
/**
 * Execute the query and get the first result.
 *
 * @param  array|string  $columns
 * @return \Illuminate\Database\Eloquent\Model|object|static|null
 */
public function first($columns = ['*'])
{
    return $this->take(1)->get($columns)->first();
}

Hello @babenkoivan
I am using the below library for MongoDB
https://github.com/jenssegers/laravel-mongodb
it return the object not array

In you code they also declare the return type "@return \Illuminate\Database\Eloquent\Model|object|static|null"
/**

Execute the query and get the first result.

@param  array|string  $columns
@return \Illuminate\Database\Eloquent\Model|object|static|null
/
public function first($columns = [''])
{
return $this->take(1)->get($columns)->first();
}

Everywhere I used the first method it returning the object... but only the above case it returning array don't know why...

Hey @vishaltomar76, I'll need your help with this. Can you maybe share what exactly $record contains? If it's an array, then please open an issue in https://github.com/jenssegers/laravel-mongodb, because it violates Laravel's first method definition.

Hey @vishaltomar76, I'll need your help with this. Can you maybe share what exactly $record contains? If it's an array, then please open an issue in https://github.com/jenssegers/laravel-mongodb, because it violates Laravel's first method definition.

Yes, $record contains an array. If i am applying Model query with first method then it always return object but if I use the DB Query builder then it returning array.
Why you are using DB query? You can also replace it by Model query then it will work fine

Hey @vishaltomar76, please open an issue in the https://github.com/jenssegers/laravel-mongodb repository. I'm pretty sure it uses the BuildsQueries trait and doesn't respect the definition of the first method:
/**
 * Execute the query and get the first result.
 *
 * @param  array|string  $columns
 * @return \Illuminate\Database\Eloquent\Model|object|static|null
 */
public function first($columns = ['*'])
{
    return $this->take(1)->get($columns)->first();
}


Add goreportcard badge

Codecov Report

Merging #552 into master will increase coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master    #552      +/-   ##
=========================================
+ Coverage   58.26%   58.3%   +0.04%
=========================================
  Files          37      37
  Lines        9877    9877
=========================================
+ Hits         5755    5759       +4
+ Misses       3088    3085       -3
+ Partials     1034    1033       -1

Impacted Files
Coverage Δ

msg.go
78.82% <0%> (+0.65%)
:arrow_up:

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 13c9225...dd70eff. Read the comment docs.


Add file_metadata field to objects schema

Feature Request
Currently, the objects schema in the Storage API schema is a light abstraction over the S3 storage. There is a metadata column in the objects table, but it corresponds to the metadata of the S3 file and cannot be used by the user.  The API does not expose any way to add related metadata to a file to the objects directly. This metadata would ideally be in JSON format to contain user-determined data. Currently, the user needs to get around this limitation by either:

Create another table that relates this metadata to the storage.objects table. This dramatically complicates querying, migrations, and client usage for something that could be colocated within the same table.
Directly modify the storage schema to add this new functionality, potentially breaking compatibility with Supabase-controlled services and implementation.

The storage API should natively support metadata, and the API / JS clients should be updated to enable this powerful and common feature for file storage management. My proposal is to add a new column called file_metadata to differentiate it to the current metadata field.

@bombillazo I generally agree that allowing Storing arbritary metadata could be a nice feature to have in Storage.
Will add this on the roadmap! 🎉

strong agree on adding custom metadata per storge object. Having to maintain a mirror table just for additional data is a pain, especially the lack of usable triggers to keeping both sides in sync.

+2 for this. I would definitely like this. would like to tag files that are being uploaded.

+1

+1 for this

Also +1

+1

+1000000000
I'm currently having to add metadata into my file names, so would love to clean up this mess!

+1 for this. I'm currently working with AI generated images and need to store the prediction parameters that generated each image.

+1

+1 looking forward to this

+1

+1

+1 looking for same

This would improve my workflow with supabase as well. Right now, I need to keep a separate table and keep it in sync every time i upload, move or delete objects.

+1
I switched from self hosting to supabase, closed down my own s3 bucket to use supabase storage, and now I can't store metadata on the objects... Please please please add this functionality!

+1 seems very helpful!!

+1

+999 would really help out majorly in making supabase storage my go to for all apps. Currently having to use alternatives despite using supabase db and auth

Great request.

@fenos on this topic, since we're not sure when we might get this, is it wise to add a custom trigger to the storage schema so that when a DELETE event happens on the objects table, we can automatically delete it in our metadata table?
These are the type of things having a dedicated file_metadata field would prevent so we wouldn't have to sync data and resources across tables.

+1

+1 it could prevent extra table for metadata

@fenos
Thank you for your work on this project. Could you please provide an example implementation for this feature? It would be really helpful for understanding how to integrate it properly.

Thanks for the update @fenos. I'm currently building my photography portfolio. I'm assuming I'd be able to store photo JSON data alongside each image uploaded to storage, correct?
If so, I'm a customer now!

Hey @fenos , I also dont see any way to pass the new user_metadata field to the POST/PUT Storage API endpoints.

@tusamni Yes correct! 🎉
@bombillazo The client-side changes are in the making

Hey there.
So...any update or documentation on this? I saw a merged PR but I couldn't find a way to have it working.
Should I go ahead and create a table and all that it implies to deal with extra data for media?
Thanks.

Yeah... any news on it would be nice.

@felipenmoura @logemann
https://github.com/supabase/storage-js/pull/207
this needs to be merged before you can use it with the client

@felipenmoura @logemann supabase/storage-js#207 this needs to be merged before you can use it with the client

Awesome, sounds great
Thanks.

+1 Waiting for this.

+1 waiting for this

++ excited for this!

+1 waiting for this feature

+1 waiting for this

I am confused. I followed the merge-chain and this feature seems to be fully merged and released. I updated my @supabase/supabase-js package so that it includes @supabase/storage-js:2.7.0. However the type FileOptions do not include a metadata field
export interface FileOptions {
  /**
   * The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the `Cache-Control: max-age=<seconds>` header. Defaults to 3600 seconds.
   */
  cacheControl?: string
  /**
   * the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`.
   */
  contentType?: string
  /**
   * When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false.
   */
  upsert?: boolean
  /**
   * The duplex option is a string parameter that enables or disables duplex streaming, allowing for both reading and writing data in the same stream. It can be passed as an option to the fetch() method.
   */
  duplex?: string
}

Similarly, neither .info() nor .exists() exist on supabase.storage.fom(bucket).
Could you update the documentation or bring me on the right track @fenos ?

@tillka you should be updating storage-js to @supabase/storage-js:2.7.1

Do I get this right that metadata does not yet work with supabase.storage? I have to use the dedicated StorageClient?
I would like to get my stored metadata through supabase.storage.list() rather than iterating over it and calling storageClient.info() for each file.

It would be really nice if supabase.storage.list() would return user_metadata along with the other file properties! We use the custom metadata field to store the original file names..
In the meantime the solution I'm using is to send a request to the backend where I query the storage.objects table directly:
    const { data, error } = await supabase
      .schema("storage")
      .from("objects")
      .select("*")
      .eq("bucket_id", bucketId)
      .eq("owner_id", userId)
      .ilike("user_metadata->>originalFileName", `%${search}%`);

It would be really nice if supabase.storage.list() would return user_metadata along with the other file properties! We use the custom metadata field to store the original file names..
In the meantime the solution I'm using is to send a request to the backend where I query the storage.objects table directly:
    const { data, error } = await supabase
      .schema("storage")
      .from("objects")
      .select("*")
      .eq("bucket_id", bucketId)
      .eq("owner_id", userId)
      .ilike("user_metadata->>originalFileName", `%${search}%`);

How are you doing this? I keep getting an error:
{
  code: 'PGRST106',
  details: null,
  hint: null,
  message: 'The schema must be one of the following: pg_pgrst_no_exposed_schemas'
}

You need to expose the storage schema from Settings > API > Exposed Schemas

+1 waiting for this feature


Revert "chore: simplify deno check:types command"

Reverts denoland/fresh#2259
Windows is failing with this change:

my PR https://github.com/denoland/fresh/actions/runs/7556810357/job/20574665605?pr=2261
your PR https://github.com/denoland/fresh/actions/runs/7543217433/job/20533721591
the commit from merging your PR https://github.com/denoland/fresh/actions/runs/7543221780/job/20533736560

Run deno task check:types
Task check:types deno check **/*.ts **/*.tsx
Error launching 'deno': The filename or extension is too long. (os error 206)
Error: Process completed with exit code 1.

@marvinhagemeister, please take a look.


script in Custom Queries?

Custom Queries are really helpful.
It's not always that easy to do everything in one sql.
I know there is plugin.  any  more plugin examples? like how to query the database (for example call preset custom queries inside plugin)?  golang is new to me.
just notice that elements in output of inFormat always come with quote,for example, {{inFormat "name"}} --> ('1','2','3'), not (1,2,3)  while &name=1&name=2&name=3.
Anyway to remove those quote?

I just realize there is one example at page https://docs.prestd.com/prestd/docs/api-reference/queries/ under split section:
"SELECT * FROM table WHERE
name IN ({{ range $index,$part := split 'test1,test2,test3' , }}{{if gt $index 0 }},{{end}}'{{$part}}'{{ end }});"
any detail about if, range? thanks

Hey @alpglide! They come as quotes because URL fields are strings whenever you pull them.
One way you can use this data is casting it, which is costly, but depending on the table size, it’s a worthy try.

Hey @alpglide! They come as quotes because URL fields are strings whenever you pull them.
One way you can use this data is casting it, which is costly, but depending on the table size, it’s a worthy try.
yes, it works. your help is appreciated!

Yes, that's my preferred way. but other team members do not want to do so. They believe it's hard to understand and maintenance. :)


Timing issues during report aggregation

As reported by Jeff Mathe
Cookbook version
0.14.1
Scenario:
A user selects multiple profiles via the audit cookbook. All profiles are downloaded and executed and reported in one report.
Expected Result:
All executed profiles are part of the report.
Actual Result:
I run multiple profiles via InSpec, but only one profile is reported to Chef Compliance / Chef Visibility. The current audit cookbook has a timing issue, where reports are not properly aggregated.

This issue is solved with version 2.0 of audit cookbook, since it is using inspec's own aggregation mechanism


Update tempfile dependency

This PR updates the tempfile dependency to 3.4, which addresses some issues with the remove_dir_all sub-dependency.

Thanks for responding! We can definitely specify the tempfile dependency in our workspace Cargo.toml, but our preference would be to avoid this and have atomicwrites avoid the vulnerable dependency.

I'm suggesting to use cargo update -p atomicwrites to update the lockfile of your application.

👍  no problems


Wrong logic on write-translation.js

Motivation
I found wrong logic on lib/write-translation.js
const path = require('path');
...
if (fs.existsSync(path)) {  // wrong code. `path` is NodeJs module
  currentTranslations = JSON.parse(
    fs.readFileSync(CWD + '/i18n/en.json', 'utf8')
  );
}

As a result, currentTranslations is always empty.
Because, the contents of i18n/en.json are always lost.
It's correct code
if (fs.existsSync(CWD + '/i18n/en.json')) {
  currentTranslations = JSON.parse(
    fs.readFileSync(CWD + '/i18n/en.json', 'utf8')
  );
}

Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Related PRs

We have had that piece of code since October 2017. Makes me wonder how translations actually have worked at all 😆 🤣

It always generate new i18en.json and is not allowing us to override localized string from what #158 intend to do. Actually this introduces bug #713

@endiliey Are you saying this fix introduces #713? Or that without this fix, #713 exists?

without this fix #713 doesnt exist
With this fix introduces #713


add: License header in the top of the files in the smswithoutborders_libsig directory.

Response of this issue.

Response of this issue.

Tip
To link your pull request (PR) to the relevant issue and ensure that the issue is automatically closed once the PR is merged, you can use GitHub's supported keywords in the PR title.
For example, you can use keywords like "fixes," "closes," or "resolves" followed by the issue number. Here’s a format you can follow:
Fixes #123

This will automatically close issue #123 when the PR is merged.
For more information on this, you can check the GitHub documentation.

Thanks for the tip.
I'm learning to contribute to projects and I'm only limited to markdowns and troubleshooting dependency errors in python.

@wuX4an, please resolve the rest of the requested changes so I can merge the PR. 🙂

@PromiseFru I already did it, sorry, I didn't know xd.

@PromiseFru I already did it, sorry, I didn't know xd.

Hey @wuX4an, you marked the requests resolved without making the necessary file changes.
Please review the comments and update the files, ratchets.py and helpers.py, before marking the conversation as resolved. :)
https://github.com/smswithoutborders/lib_signal_double_ratchet_python/pull/16#discussion_r1775149792
https://github.com/smswithoutborders/lib_signal_double_ratchet_python/pull/16#discussion_r1775160032

@PromiseFru I already did it, sorry, I didn't know xd.

Hey @wuX4an, you marked the requests resolved without making the necessary file changes. Please review the comments and update the files, ratchets.py and helpers.py, before marking the conversation as resolved. :)
#16 (comment) #16 (comment)

Oh, F***k. I didn't realize xd


Pulling Forwarded Site in at Header and Footer when working from mapped hosts file.

Not sure exactly why this is happening yet, but am working on a site who's domain name still points to the previous host. So have updated the hosts file on the local development machine so that www.theshelterinquestion.com is mapped to the development server's IP address.
The URL www.theshelterinquestion.com is forwarded to a petfinder "site" (actually a single page), and the contents of this page are being pulled embedded into both the header and footer of the Harbor theme. Never seen this before. Not happening with any of the default WP themes.
I hope the description is clear. The embedding is occurring at:
		<script type='text/javascript' src='http://www.theshelterinquestion.com/wp/wp-includes/js/admin-bar.min.js?ver=4.4.2'></script>

		<script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ALL HTML FROM PAGE HERE...

	if ( 'querySelector' in document && 'addEventListener' in window ) {
				loadJS('http://www.theshelterinquestion.com/wp/wp-content/themes/harbor-wp-theme/dist/js/main.min.2.16.0.js');
				// loadJS('http://www.theshelterinquestion.com/wp/wp-content/themes/harbor-wp-theme/dist/js/main.js');

I think the solution may be in removing the domain name from the 'loadJS' call and just calling from the relative directory.
I imagine I can work around it if I'm able to update the hosts file on the shared server, or by actually "going live" with the site, but it would be nice to determine the cause of this behavior.

I'm afraid I'm going to have to close this one out as wildly out of scope for this project. There are just too many variables and unknowns that I have no visibility to and can't speak to. Sorry!

The two functions that are causing the issue are keel_load_inline_footer and keel_load_inline_header. I tried, briefly and unsuccessfully, to use a full path rather than a URI by replacing get_template_directory_uri() with get_template_directory(). It seems like the theme should work even with DNS not being set-up, but for now I'm just going to comment out add_action('wp_head', 'keel_load_inline_header', 30); and also the keel_load_inline_footer reference until DNS is changed.


Expose secondary action on screen component

Background
Part of https://github.com/Shopify/pos-next-react-native/issues/27009
(Provide a link to any relevant issues AND provide a TLDR of the issue in this pull request)
As part of stocky work for M2, we need to expose secondaryAction for the screen component. The component itself already exists.
Solution
(Describe your solution, why this approach was chosen, and what the alternatives/impacts may be)
Let me know if the typing or documentation is correct.
🎩

...

Checklist

[x] I have :tophat:'d these changes

You have to export the new secondary action interface but other than that it looks great! You can search ActionProps and see where to update the changes.


claimTo for Drop and BundleDrop

@ayshptk let's not change the interface. claim should keep default to 0s

@ayshptk let's not change the interface. claim should keep default to 0s

Lets add tests for these new methods.

@atbe added


re-enable units after tests

one-liner change
on the current master, if you run python -c "from gpkit.tests import run; run(); from gpkit import Variable; assert Variable('x', 'ft').units is not None"
you get:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError

this fixes that.
@bqpd, ready for review

lol! ready to merge once tests pass.

oops, I rebase-merged instead of squash-merging, and as a result the PR number doesn't show up in master's commit history. My bad, will get it right next time.


Please update list of supported OS for agents

Is the list of supported OS for agents still up to date?
It seems to be outdated.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: f64ca92c-b7d5-3142-71fb-306d32a37281
Version Independent ID: dfef40cf-2f50-4c03-bc97-bafa6c305108
Content: Deploy an Azure Pipelines agent on Linux - Azure Pipelines
Content Source: docs/pipelines/agents/v2-linux.md
Product: devops
Technology: devops-cicd-agents
GitHub Login: @steved0x
Microsoft Alias: sdanie

It was reviewed and updated July 9. If the list still looks incorrect, please file a new issue and I will investigate further. Thank you


Completions ignore field visibilities for crates in the same cargo workspace

Using rust-analyzer nightly 2021-08-13 c00ccdeb5.
For crates in the same cargo workspace (source root?), completions include all fields of a struct, instead of respecting the visibilities of each field.
For example:
pub mod hide {
    pub mod stuff {
        #[derive(Default)]
        pub struct SomeFields {
            a: (),
            pub(super) b: (),
            pub(crate) c: (),
            pub d: (),
        }
    }
}

fn main() {
    let s = crate::hide::stuff::SomeFields::default();
    s.<|>
}

a, b show up in the completion list, even though they aren't visible there.
If hide was in another crate in the same cargo workspace, c would still be included in the completion list.
This issue does not apply to structs in external crates or in std or core, which I assume is because they are in different source roots.

So I noticed that this is an intentional feature (as part of #9684), but would it be possible to have this behind a config flag?


Add getpwnam and related functions

This PR closes #862.
Implemented functions:

As User::query:

getpwnam
getpwuid

As Group::query:

getgrgid
getgrnam

As Users iterator:

getpwent
setpwent
endpwent

As Groups iterator:

getgrent
setgrent
endgrent

~I wanted to implement getgrent, setgrent and endgrent, but they are missing from libc. (See https://github.com/rust-lang/libc/issues/923 )~

I was able to get a bunch of functions added to libc in rust-lang/libc#934 .
I am now working on getting the APIs I added there into nix again. Hoping no more libc changes are needed.

@kristate @asomers @Susurrus I would very much appreciate it if y'all could read what I wrote in the commit message here https://github.com/nix-rust/nix/pull/864/commits/36125265ea9b2f7d57f6a4936a3a6184e3421589
I'm worried that this problem will cause all my work on this PR to go to waste, very stressed since I've poured hours into this already :cry:

I don't know why the test system is doing this:
   Compiling libc v0.2.38 (https://github.com/rust-lang/libc#936e16bc)
   Compiling libc v0.2.37

Why it immediately compiles old version after new? I got a PR into libc for the express purpose of getting this PR into nix, so using 0.2.38 is an absolute must. My branch will not compile without it.

:worried:

We already have a way of serializing tests that use global variables.  Look in tests/test.rs at the bottom.  There are several mutexes there.  You should add another one to protect the global variables used by the getpwent family of functions.

Oh okay thanks, I get it, I'll make the tests use that when I get home from church, as well as deal with your other concerns 😃

Alright, got a bunch of work done today, but as you can see from the failing builds there is still more to do :-)
Thank you everyone for your patience with me while I sort this out. Just realized I'm going to have to open another libc PR as my original accidentally neglected FreeBSD.

FreeBSD build will stop failing when https://github.com/rust-lang/libc/pull/939 is merged.

Hey @asomers , really curious what you think of this API for querying instead of just exposing the functions. It's getting late here, if you like it I'll make the Group version of it tomorrow.

P.S. Anybody know what's up with https://travis-ci.org/nix-rust/nix/jobs/349841588 ? I can't get test_users_iterator_smallbuf to do that on my Linux VM.

The query API could certainly work.  One problem is that it's not specific enough.  Why have enum values that can't be used to look up a user?  Why have values that can't be used to look up a group?  Better to have one enum for User queries, and one for Group queries.  That way you'll catch usage problems at compile time.  Another problem is that you aren't handling "user not found" errors correctly.  You shouldn't return an Errno in that case.

Happy to report my build is now passing :D
If you have no more concerns it's ready to be merged. I responded to or fixed every concern in the previous reviews to my knowledge (hope I didn't miss anything).
@asomers @Susurrus @kristate

@asomers Any further concerns?

There are still two things that concern me:

You have some really big unsafe blocks.
You have some from functions that take their arguments by value, even though it looks like a reference would work fine.  Unless it's absolutely necessary, it's better to take arguments by reference.  That gives the caller more flexibility.

@asomers https://github.com/nix-rust/nix/pull/864/commits/f47800c409fb27065d4d613c92c03952223dadbf
Hoping this will be the final commit. 🤞

Why did you use raw pointers instead of references?  Dereferencing raw pointers is unsafe.

@asomers Because I only ever convert libc::passwd and libc::group from raw pointers, and that is the only way to get their data. A reference to one of them would just be a reference to a raw pointer...I think. You have to dereference them, I just changed where that happens.

Yeah, but you moved the raw pointer dereference into part of the public API!  And in a safe function, no less!  That means that any user can pass us a *const libc::passwd (which they can create in safe code by casting), and we'll dereference it and potentially crash.  That's not ok.  We need to control when and where that pointer is dereferenced.  It should only happen when we have control of how the pointer was created, and we know that it's valid.

@asomers OK, I understand. Thank you very much for the explanation. I'm sorry if I'm annoying you. This is my first major commit to a Rust library. I'll think about how to handle this. Maybe using the From trait at all is unwise, I think probably this should not be public.

OK, sorry everyone, the priorities of my company changed so I hadn't had much time to work on this, but the microservice I wrote which uses this API is back under scrutiny again so I'll be soon working on getting this commit into nix since we do not want to use private branches of modules if we can help it for important parts of our code.

@ctrlcctrlv I'll ping for an update as well; I'm making some updates to gpio-utils and have a need for this functionality and might be able to help out if that is desired.

@posborne Feel free to help out.

@posborne I answered @Susurrus 's most difficult question ( https://github.com/nix-rust/nix/pull/864#discussion_r226161818 ) for someone who is new to this PR...I'd say that beyond that the only thing that is particularly difficult is going to be turning my cfg(not(any(...))) into a cfg(any(...)) as he requested. Feel free to make commits directly to https://github.com/ctrlcctrlv/nix , I sent you an invite to be a collaborator.

@posborne I answered @Susurrus 's most difficult question ( #864 (comment) ) for someone who is new to this PR...I'd say that beyond that the only thing that is particularly difficult is going to be turning my cfg(not(any(...))) into a cfg(any(...)) as he requested. Feel free to make commits directly to https://github.com/ctrlcctrlv/nix , I sent you an invite to be a collaborator.

Ok, I'll take a fresh look.  For my short term needs, I ended up using the users crate which provided what I needed along with chown from nix (this crate also provides caching for user/group lookups which is a nice feature).  Would still be good to see this land here to get safe libc coverage parity.

@posborne Yes, that is the unfortunate reality of this PR; due to its length and the number of changes requested, it's much easier to just maintain a private branch or use another crate than get this finished. I was on a deadline when I wrote the package that I had to change nix for, and that afforded me some time to try to get it upstreamed, but after several back and forths I could no longer  spend so much time on this. I'm not blaming anyone, code quality is very important and most of the changes requested are merited; I'm rather simply stating the reality of open source work-for-hire...

@posborne Yes, that is the unfortunate reality of this PR; due to its length and the number of changes requested, it's much easier to just maintain a private branch or use another crate than get this finished. I was on a deadline when I wrote the package that I had to change nix for, and that afforded me some time to try to get it upstreamed, but after several back and forths I could no longer  spend so much time on this. I'm not blaming anyone, code quality is very important and most of the changes requested are merited; I'm rather simply stating the reality of open source work-for-hire...

@posborne Yes, that is the unfortunate reality of this PR; due to its length and the number of changes requested, it's much easier to just maintain a private branch or use another crate than get this finished. I was on a deadline when I wrote the package that I had to change nix for, and that afforded me some time to try to get it upstreamed, but after several back and forths I could no longer  spend so much time on this. I'm not blaming anyone, code quality is very important and most of the changes requested are merited; I'm rather simply stating the reality of open source work-for-hire...

@posborne Yes, that is the unfortunate reality of this PR; due to its length and the number of changes requested, it's much easier to just maintain a private branch or use another crate than get this finished. I was on a deadline when I wrote the package that I had to change nix for, and that afforded me some time to try to get it upstreamed, but after several back and forths I could no longer  spend so much time on this. I'm not blaming anyone, code quality is very important and most of the changes requested are merited; I'm rather simply stating the reality of open source work-for-hire...

@posborne Yes, that is the unfortunate reality of this PR; due to its length and the number of changes requested, it's much easier to just maintain a private branch or use another crate than get this finished. I was on a deadline when I wrote the package that I had to change nix for, and that afforded me some time to try to get it upstreamed, but after several back and forths I could no longer  spend so much time on this. I'm not blaming anyone, code quality is very important and most of the changes requested are merited; I'm rather simply stating the reality of open source work-for-hire...

@posborne Yes, that is the unfortunate reality of this PR; due to its length and the number of changes requested, it's much easier to just maintain a private branch or use another crate than get this finished. I was on a deadline when I wrote the package that I had to change nix for, and that afforded me some time to try to get it upstreamed, but after several back and forths I could no longer  spend so much time on this. I'm not blaming anyone, code quality is very important and most of the changes requested are merited; I'm rather simply stating the reality of open source work-for-hire...

@posborne Yes, that is the unfortunate reality of this PR; due to its length and the number of changes requested, it's much easier to just maintain a private branch or use another crate than get this finished. I was on a deadline when I wrote the package that I had to change nix for, and that afforded me some time to try to get it upstreamed, but after several back and forths I could no longer  spend so much time on this. I'm not blaming anyone, code quality is very important and most of the changes requested are merited; I'm rather simply stating the reality of open source work-for-hire...

@ctrlcctrlv would you mind me adopting this PR? (although i'm not sure on the concrete procedure, i think it would be a new PR in the end)

@dario23 There's no reason to start from scratch. I added you as a contributor to ctrlcctrlv/nix. :smile: Accept and you can push directly to this PR.

this set of commits is to address issues by @Susurrus, i'll dig through it all for @asomers's reviews as well, not sure i'll get to it today.

What's the status of this PR?

I am also interested on this PR as I need this for an app.

so i rebased onto latest master and incorporated the reviews so far, i think one open point is the cfg(not(target_os="android")) change, i'm still not convinced having a lengthy explicit list on each of the struct fields is gaining anything in clarity; @Susurrus could you elaborate on why that seems neccessary to you?

ci currently fails on deprecated libc::uintXY_t types, hope i'll get to #1072 soon.

This PR is quite old.  If @ctrlcctrlv is still interested we can pick it up again.  But you'll first need to rebase and fix the CI failures.  Then I'll have to review it again, starting from scratch.

If no one is interested in picking this up, I'd like to work on this.

Sent you an invite @otavio.

@asomers I just did the rebase of the current code and will start digging into the issues.
Is it possible to list the known issues I have to rework?

What do you mean by "Known issues I have to rework?"

What do you mean by "Known issues I have to rework?"

The issues pending for the review to be considered done. The discussions above are a little messy and I am unsure what is still open.

It's been so long; I think we should squash everything and restart the review.

Cool! Will squash it all and we start from there.

@asomers done. I fixed minor things and also reverted wrong code removal.
Please go over it so we can work on pending items :-)

@asomers I cleaned some leftover cfg constrains which are not need and it seems good.
I wonder if we shouldn't use getpwent_r and handle the concurrency ourselves getting wider support as getpwent is the POSIX compliant one.

@asomers I addressed most of the comments.
I wonder if the use of reentrant is better than handling locking internally?
Please take a look so we address any further issues.

Please don't force push while a review is going on.  It makes review much harder.  Squashing should only come at the end, once the review is complete (yesterday I asked you to squash just because the review was so old that I wanted to start over, but I intended that to be a one-time thing).  Can you restore the PR to the state it was in yesterday when I made my comments, and then incrementally push from there?  I think I reviewed as of revision 0846f15 .

Please don't force push while a review is going on. It makes review much harder. Squashing should only come at the end, once the review is complete (yesterday I asked you to squash just because the review was so old that I wanted to start over, but I intended that to be a one-time thing). Can you restore the PR to the state it was in yesterday when I made my comments, and then incrementally push from there? I think I reviewed as of revision 0846f15 .

Done. Sorry for the noise.

I wonder how getspnam(3) and friends (getspent, setspent, endspent, ...) could (or should) fit in this, if at all.

Yes, that's the right way to handle the vectors. But you need to use std::mem::MaybeUninit for passwd rather than mem::uninitialized.

Done.

I wonder how getspnam(3) and friends (getspent, setspent, endspent, ...) could (or should) fit in this, if at all.

I think this should be handled in another PR as seems not related.


Add functions to patch a string

Sourceror.to_string/2 allows one to convert AST to string ensuring the comments land where they should. The issue is that even if after a manipulation only a little portion of the code is changed, the whole string will be formatted. This is not an issue if the user is already using the elixir formatter, but it is a problem otherwise.
It is possible to replace only subsets of a string by using Sourceror.get_range/1 in combination with Sourceror.to_string/2 to find the range where a modification would occur and replace it with the new text, but it would be nice for that functionality to be included in Sourceror itself.
A Sourceror.patch_string/2 could be introduced, taking the string to be changed as a first argument and a list of patches to be applied to it. A patch is a map holding the range that would be affected, and the text that would replace the old content.
The main issue is that the fixes should not have overlapping ranges. For example, in this code:
unless not allowed? do
  String.to_atom(foo)
end

One of the patches may want to replace String.to_atom(foo) with String.to_existing_atom(foo), while other patch may want to replace the whole unless with an if allowed? do ... end. There is an obvious conflict there, which limits the usefulness of this approach.
Another alternative is to add a function that instead of patching the string based on a list of patches, it accepts a function that traverses and updates the ast, and then does some tree-diffing magic to figure out the final set of changes to be applied, in a way that the two conflicting patches of the previous example would become a single patch that changes all at once.
I have already explored the first idea and found those limitations, which is why I will now start exploring the second one. The other aspect to keep in mind is the indentation of the patches if they span multiple lines, but we should be able to infer it from the surrounding lines.

The second approach could be used to generate the list of patches, by picking the outermost changed node, and then feeding those to the function from the first apprach?

Hi @doorgan!
I have the feeling that trying to apply multiple patches at once might be very hard or even not possible due to the possible conflicts you already mentioned. A change in the inner node might completely invalidate the pattern used to match the outer node in the first place.
Since a change in a node can also impose an update in the metadata of any of the parent nodes as well as in all the nodes after that change, I believe the safest approach could be to apply one by one, like:

Look for the first matching node to replace
If found, replace it and recalculate the metadata of affected nodes. Otherwise, we're done.
Repeat

One thing that needs to be treated with this approach would be a scenario where the user accidentally introduces an infinite loop by adding two opposite replacements, for instance, replace :a -> :b and later replace :b -> :a.

Hi @msaraiva! Thanks for your thoughts :)
I have the same feeling, the more I dig into it the more I see there's not really a way to apply multiple patches without getting in trouble. Also, if the point of the function is to avoid messing up existing code formatting, even applying changes one by one is troublesome, for example if you want to change the name of a function and it's written like this:
defp decode(addr_t(:ind), _dest, data) do
  case data do
    <<0::6, data::bits>>            -> {:t_data_ind, nil, data}
    <<0b01::2, seq::4, data::bits>> -> {:t_data_con, seq, data}
    <<0b1000_0000::8>>              -> {:t_connect, nil, <<>>}
    <<0b1000_0001::8>>              -> {:t_discon, nil, <<>>}
    <<0b11::2, seq::4, 0b10::2>>    -> {:t_ack, seq, <<>>}
    <<0b11::2, seq::4, 0b11::2>>    -> {:t_nak, seq, <<>>}
    _                               -> {:error, :invalid_tpci}
  end
end

If we want to change the name of the function, we would completely break the tabular formatting of the code in the body.
I've also been digging into tools for other languages, and they don't have this kind of issues because they implement their own printer(recast for instance uses a custom "non-destructive" printer), while Sourceror is built on top of the Elixir formatter.
So I'm tempted to think a better and less hacky way to handle this use case is to make Sourceror.to_string/2 to accept a formatter module as an option, and to implement a formatter that prints code that is as close as possible to the original source code. Of course, this is a lot more work to do, but maybe it's the best approach?

Not sure. I mean, by just loading the consolidated configuration of the .formatter files to keep the formatting applied by Sourceror.to_string/2 consistent would already be a very good solution for anyone using the formatter.
For other cases, would it be possible to keep the original related source of each node somewhere? Then have some kind of metadata to mark the node as "changed", allowing the tool to generate the code only for those changed nodes, keeping the others untouched?
I have no idea if this is feasible or not. Probably not, I guess :)
Also, even if we can't go this direction, I believe a Sourceror.patch_string/2 receiving a single range to patch could still be useful. Specially for tools that only need to apply simple small patches. It would also allow those tools to implement their own solutions, even if it requires to do multiples read file -> patch -> read file again -> patch. Depending on the changes required, that might work. For instance, it would have worked for all the changes we had for the Surface converter.

Also, even if we can't go this direction, I believe a Sourceror.patch_string/2 receiving a single range to patch could still be useful. Specially for tools that only need to apply simple small patches. It would also allow those tools to implement their own solutions, even if it requires to do multiples read file -> patch -> read file again -> patch. Depending on the changes required, that might work. For instance, it would have worked for all the changes we had for the Surface converter.

This sounds like a reasonable step for now. I guess what I'm worried about is messing up the content inside the node as exemplified above, but producing code that matches the original source as much as possible could be thought of as a middle-long term goal.

For other cases, would it be possible to keep the original related source of each node somewhere? Then have some kind of metadata to mark the node as "changed", allowing the tool to generate the code only for those changed nodes, keeping the others untouched?
I have no idea if this is feasible or not. Probably not, I guess :)

If think having metadata to mark the node as "changed" is feasible. It's even one approach I've been playing with in my mind. The Clojure's zipper api does this to keep track of the nodes that changed and so reconstruct the tree when returning to the top level node, and it's something I didn't implement in Sourceror's Zipper api because I didn't find a use for it, but this would be one use case. The changed mark could also store the original range so we can map them back to the range they would replace. Then all we need to do is to perform an additional traversal to find which nodes changed, grab their ranges and build a patch from them. If a node changed then we don't care if their children changed too, we only care about the outermost node, so we avoid the "child invalidating parent change and viceversa" issue.
If one uses the Zipper api, then functions like replace/2 or insert_child/2 would already be able to add the "changed" marker. We would need to figure out a way to tell that the node at X range was deleted, but if the zipper metadata holds the list of patches itself, then it wouldn't be an issue. The zipper is a {node, metadata} tuple where the metadata holds the parent tree and siblings, but it could also hold additional metadata. When the zipper is at the top the metadata is nil or :end, but it would be good to change it to a map so it can hold this additional metadata
As for regular pre/postwalk traversals, we could make Sourceror.pre/postwalk to make a simple equality check comparing the node before and after applying the functions over them, and store a patch in the traversal state if the node changed.
Sourceror.patch_string/2 could still accept a list of changes, and if a patch contains or is contained by another patch's range, then that's up to the user to fix, and it would still enable the "apply changes one by one" approach. I already have working code for this, I just need to iron out the indentation handling.
So maybe I can add this, and then figure out ways to generate lists of patches in another issue :)

Sounds like very good plan to me! 👍

I just implemented this in 245952a, I'm quite happy with it.
I will now start looking for ways to generate the patch lists with other functions.
I'll let this issue open for a bit just in case before 0.8 is release, but it's ready to be closed.

Hi @doorgan. That's fantastic!
I'm tried the following snippet in order to collect the ranges to be used by the new patch_string for one of the changes I needed for the converter. However, I wasn't able to use Sourceror.get_range/1.
The end goal is to rename the slot's option props: ... to args: ....
Not sure if that would be possible already.
Mix.install([{:sourceror, github: "doorgan/sourceror"}])

code = """
defmodule Card do
  use Surface.Component

  slot footer
  slot header, props: [:item]
  slot default, required: true, props: [:item]
end
"""

ranges =
  code
  |> Sourceror.parse_string!()
  |> Sourceror.postwalk([], fn
    {:slot, _, args} = quoted, state ->
      opts_node = Enum.at(args, 1, [])
      props_node = Enum.find(opts_node, &match?({{:__block__, _, [:props]}, _}, &1))

      if props_node do
        range = Sourceror.get_range(props_node)
        {quoted, %{state | acc: [range | state.acc]}}
      else
        {quoted, state}
      end

    quoted, state ->
      {quoted, state}
  end)

IO.inspect(ranges)

The error:
** (FunctionClauseError) no function clause matching in Sourceror.Range.get_range/1

    The following arguments were given to Sourceror.Range.get_range/1:

        # 1
        {{:__block__, [trailing_comments: [], leading_comments: [], format: :keyword, line: 5, column: 16], [:props]}, {:__block__, [trailing_comments: [], leading_comments: [], closing: [line: 5, column: 29], line: 5, column: 23], [[{:__block__, [trailing_comments: [], leading_comments: [], line: 5, column: 24], [:item]}]]}}

    Attempted function clauses (showing 10 out of 17):

        def get_range({:__aliases__, meta, segments})
        def get_range({:__block__, meta, [string]}) when is_binary(string)
        def get_range({:__block__, meta, [number]}) when is_integer(number) or is_float(number)
        def get_range({:__block__, meta, [atom]}) when is_atom(atom)
        def get_range({:__block__, _, args} = quoted)
        def get_range({form, meta, context}) when is_atom(form) and is_atom(context)
        def get_range({{:., _, [Access, :get]}, _, _} = quoted)
        def get_range({{:., _, [_, :{}]}, _, _} = quoted)
        def get_range({{:., _, [:erlang, :binary_to_atom]}, meta, [interpolation, :utf8]})
        def get_range({{:., _, [left, right]}, meta, []} = quoted) when is_atom(right)
        ...
        (7 clauses not shown)

    (sourceror 0.7.0) lib/sourceror/range.ex:14: Sourceror.Range.get_range/1
    replace_props_wiht_args.exs:22: anonymous fn/2 in :elixir_compiler_0.__FILE__/1
    (stdlib 3.15) lists.erl:1358: :lists.mapfoldl/3
    (stdlib 3.15) lists.erl:1359: :lists.mapfoldl/3
    (elixir 1.12.1) lib/macro.ex:448: Macro.do_traverse/4
    (elixir 1.12.1) lib/macro.ex:463: Macro.do_traverse/4
    (stdlib 3.15) lists.erl:1358: :lists.mapfoldl/3
    (elixir 1.12.1) lib/macro.ex:468: Macro.do_traverse/4

I'm sure I'm doing something wrong :)

It's actually a bug in get_range, I'm not accounting for the 2-tuples in keyword lists. I just pushed a fix, the script works now :)

Nice! 🔥
I just tried the latest Sourceror.patch_string/2.
With this code:
Mix.install([{:sourceror, github: "doorgan/sourceror", tag: "14e58a3caa2cb61fc42dfeeabcc3982fd83c3591"}])

code = """
defmodule Card do
  use Surface.Component

  slot footer
  slot header, props: [:item]
  slot default, required: true, props: [:item]
end
"""

patches =
  code
  |> Sourceror.parse_string!()
  |> Sourceror.postwalk([], fn
    {:slot, _, args} = quoted, state ->
      opts_node = Enum.at(args, 1, [])
      props_node = Enum.find(opts_node, &match?({{:__block__, _, [:props]}, _}, &1))

      if props_node do
        range = Sourceror.get_range(props_node)
        {{:__block__, meta, [:props]}, body} = props_node
        args_node = {{:__block__, meta, [:args]}, body}
        new_code = Sourceror.to_string(args_node)
        patch = %{text: new_code, range: range}

        {quoted, %{state | acc: [patch | state.acc]}}
      else
        {quoted, state}
      end

    quoted, state ->
      {quoted, state}
  end)
  |> elem(1)
  |> Enum.reverse()

code
|> Sourceror.patch_string(patches)
|> IO.puts

I got the following result, which is not valid yet but it's almost what I needed :)
defmodule Card do
  use Surface.Component

  slot footer
  slot header, {:args, [:item]}
  slot default, required: true, {:args, [:item]}
end

I guess, since I'm using Sourceror.to_string(args_node) to generate the replacement text, there's no way for the formatter to know how to properly format the option.
What would be the best way to achieve this? Should I take another path?
Would alternatively accepting patches with an updater instead of a string do the trick?, Like:
%{
  update: &rename_props/1,
  range: %{start: [line: 1, column: 1], end: [line: 3, column: 4]}
}

where rename_props/1 could be something as simple as:
defp update_props(original_code) do
  String.replace_leading(original_code, "props:", "args:")
end

In case you're already satisfied with the current Sourceror.patch_string/2 implementation and you think this is a rare edge case, no worries. I'll try to find an alternative way to handle it, maybe by updating the whole slot call.
Thanks for the quick replies and for the great work! ❤

I guess, since I'm using Sourceror.to_string(args_node) to generate the replacement text, there's no way for the formatter to know how to properly format the option.

Yes, this is correct. Even if the key node has the format: :keyword metadata, the formatter doesn't know that this is happening in the context of a keyword list and will print it as a tuple. I'm not sure of how to address this in a generic way, but you would wrap the 2-tuple in a list, print it, and remove the wrapping braces with String.slice(1..-2)?
For example:
iex> {_, _, [[tuple]]} = Sourceror.parse_string!("[foo: :bar]")
iex> Sourceror.to_string([tuple]) |> String.slice(1..-2)
"foo: :bar"

In case you're already satisfied with the current Sourceror.patch_string/2 implementation and you think this is a rare edge case, no worries.

I'm open to supporting other updating modes as well, maybe we can use a generic :change field that can be:

A string(current behavior)
A function of arity 1 that takes the original code in the patch range as argument and outputs a string

What do you think?

you could wrap the 2-tuple in a list, print it, and remove the wrapping braces with String.slice(1..-2)?

Yeah, that would work for sure.

The function patch has the other benefit of allowing you to apply fine grained changes to the code without messing up the surrounding formatting, but doesn't have the issue of making a change to the wrong ranges that regexes have.
What do you think?

I think it would be extremely useful, especially because we could still use the AST to locate the minimum spot to be changed and use regex just in that small place, which would be a good middle ground.

Great, I will change that then!
As for printing a keyword list fragment, it seems that's the only special case of that kind, and it's common enough to be an annoyance. I don't think it deserves its own function, but maybe I can make Sourceror.to_string handle that special case?
I'm thinking of adding a :format option that automatically performs the wrapping and slicing when it's set to :keyword? It would mimic the metadata.

@doorgan the solution using Sourceror.patch_string/1 works perfectly for the cases I tested. Fantastic work! ❤

I'm thinking of adding a :format option that automatically performs the wrapping and slicing when it's set to :keyword? It would mimic the metadata of the keyword tuple.

So you mean something like:
iex> quoted = Sourceror.parse_string!("[{:a, 1}, {:b, 2}]")
iex> Sourceror.to_string(quoted, format: :keyword)
"a: 1, b: 2"

So you mean something like:
iex> quoted = Sourceror.parse_string!("[{:a, 1}, {:b, 2}]")
iex> Sourceror.to_string(quoted, format: :keyword)
"a: 1, b: 2"

Yes, that's the idea, but there are some caveats when it comes to a list of tuples instead of a single tuple, I opened #18 with more details :)

Closing as the main point of this issue is resolved :)


Adding new maintainer

Adding new maintainer https://github.com/rizafahmi
He done works on the ReasonML translation before.
cc @regalius @arfianadam

Welcome, let's do this, mas @rizafahmi 😁


Add Profile Component

I've added profile component which can be visited from team page or alumni, I grouped the data to a separate file "constants.js" in order to become centralized. you need to improve the dummy data for the profile page.

you done a great thing brother but it is not responsive it should be? make it responsive for all views..or i have to revert the pr im soory coz it look messy...please fork the new code since i had to make certain changes to make it wrking..Work in Development1.0 you code is pushed there temprorarily


Add MVP bridge functionality to the frontend

@victortokaito please add Figma link

https://www.figma.com/file/hZlR0KWL0V1wLxoggB0ry0/Bridge-Integration-UI-Sketch?node-id=234%3A36064


Rework how statuses are written during dag rebuild

Currently status writing is handled as part of the CacheHandler.OnUpdate operation. The dag.DAG contains a Statuses method which returns status objects collected during the dag build. This approach has several limitations
1a. Status writing causes the cache handler to have a reference to the Contour k8s Client so it can write status back to the API server. Ideally the CacheHandler would have no knowledge of k8s at this point--its role is to manage the internal/contour visitors and hold their output.
1b. Visitation occurs after DAG build so any problems encountered by the visitors should by unrelated to k8s objects as the DAG abstracts said objects.
2. Status update has always been a second class citizen. Because and continuing this fact is there are few tests of status because they occur outside the dag build cycle, and the ones that we do have are specific to IngressRoute. There are no e2e tests of status.
3. We only report status for IngressRoute objects, not Ingress, not HTTPLoadBalancer, etc.
4. Status updates are tied to dag regeneration and this has a long history of producing duplicates, not to mention multiple contours trying to update the same object.
I propose introducing a layer of abstraction conceptual equivalent to a logger. To set the context, with Logrus we pass down into various things a FieldLogger, which is an object which collects bits of context along the way. At the bottom of the call chain, when something wants to log it doesn't need to have all the context of the various pieces that were added to the logger's context on the way down, they're already present in the FieldLogger.
I'm proposing something similar for status, a status logger or writer which collects context as it is used. The primary context is obviously the k8s object that is being worked on at the moment, but as we dig deeper into the object it might be a route, a service connected to a route, etc. There are also aspects of the builder pattern as we want to collect multiple units of status per object then emit them once
The overall API might look something like this
type StatusWriter interface {
        WithObject(obj interface{}) ObjectStatusWriter
}

type ObjectStatusWriter {

        // various logging methods

        // Commit writes the colletive status back to the API server
        Commit() error
}

This would let us decouple anything wanting to write status from the actual status writing operation itself. WithObject(obj).Commit() would be a noop if there was no status to write. It would also let us test status writing directly to the fake k8s client rather than a side effect of dag building.

@davecheney is this all fixed up with #1475?


feat!: collapse extraneous XBlock mixins

Supporting info
Proposed in this DEPR issue:

https://github.com/openedx/XBlock/issues/714

excerpt:

The implementations of the XBlock and XBlockAside classes are chopped into about a dozen tiny mixins. This was done many years ago, probably for some mix of reasons including code organization and theoretical reusability. Now, in 2024 in the openedx GitHub org, there are uses of the XBlock, XBlockAside, and XBlockMixin classes, but we do not see uses of any of the other classes or mixins (other than one extraneous reference to HandlersMixin in edx-platform, which can be removed).

Unfortunately, these mixins make it harder/impossible to write robust type constraints for XBlock and XBlockAside. They also make it harder to find code in the XBlock package. See discussion.

The edx-platform upgrade PR is here:

https://github.com/openedx/edx-platform/pull/34231

Description
Various extraneous classes have been removed from the XBlock API. We believe that most, if not all, XBlock API users will be unaffected by this change.
Diagram
Generated with pyreverse and dot.
Before

After

Change list

Removed:

xblock.XBlockMixin (still available as xblock.core.XBlockMixin)
xblock.core.SharedBlockBase (replaced with xblock.core.Blocklike)
xblock.internal.Nameable
xblock.internal.NamedAttributesMetaclass
xblock.django.request.HeadersDict
xblock.fields.XBlockMixin (still available as xblock.core.XBlockMixin)
xblock.mixins.RuntimeServicesMixin
xblock.mixins.ScopedStorageMixin
xblock.mixins.IndexInfoMixin
xblock.mixins.XmlSerializationMixin
xblock.mixins.HandlersMixin
xblock.mixins.ChildrenModelMetaclass
xblock.mixins.HierarchyMixin
xblock.mixins.ViewsMixin

Added:

xblock.core.Blocklike, the new common ancestor of XBlock and XBlockAside, and XBlockMixin, replacing xblock.core.SharedBlockBase.
New attributes on xblock.core.XBlockAside, each behaving the same as their XBlock counterpart:

usage_key
context_key
index_dictionary

Various new attributes on xblock.core.XBlockMixin, encompassing the functionality of these former classes:

xblock.mixins.IndexInfoMixin
xblock.mixins.XmlSerializationMixin
xblock.mixins.HandlersMixin

Docs

Various docstrings have been improved, some of which are published in the docs.
XBlockAside will now be represented in the API docs, right below XBlock on the "XBlock API" page.
XBlockMixin has been removed from the docs. It was only ever documented under the "Fields API" page (which didn't make any sense), and it was barely even documented there. We considered adding it back to the "XBlock API"  page, but as noted in the class's new docstring, we do not want to encourage any new use of XBlockMixin.

Bumps version from 2.0.0 to 3.0.0.
Testing
Docs
You can preview the doc additions by clicking "Details" on the docs build, hitting "View Docs", and going to the "XBlock API" page).
Homepage: https://docsopenedxorg--718.org.readthedocs.build/projects/xblock/en/718/index.html
New XBlockAside generated docs: https://docsopenedxorg--718.org.readthedocs.build/projects/xblock/en/718/xblock.html#xblock.core.XBlockAside
XBlock and XBlockAside attributes
From the root of the repo, you can run this script in order to compare the list of attributes on XBlock/XBlockAside before and after this PR, both for the classes and their instances.

rm -rf dir_before dir_after
mkdir dir_before dir_after

cd dir_before
git switch master
python -c 'from xblock import core; print(*sorted(dir(core.XBlock)), sep="\n")' > block_cls.list
python -c 'from xblock import core; print(*sorted(dir(core.XBlock(None, None, None))), sep="\n")' > block_obj.list
python -c 'from xblock import core; print(*sorted(dir(core.XBlockAside)), sep="\n")'  > aside_cls.list
python -c 'from xblock import core; print(*sorted(dir(core.XBlockAside(None, None, runtime=None))), sep="\n")' > aside_obj.list
cd ..

cd dir_after
git switch kdmccormick/mixins
python -c 'from xblock import core; print(*sorted(dir(core.XBlock)), sep="\n")' > block_cls.list
python -c 'from xblock import core; print(*sorted(dir(core.XBlock(None, None, None))), sep="\n")' > block_obj.list
python -c 'from xblock import core; print(*sorted(dir(core.XBlockAside)), sep="\n")'  > aside_cls.list
python -c 'from xblock import core; print(*sorted(dir(core.XBlockAside(None, None, runtime=None))), sep="\n")' > aside_obj.list
cd ..

diff dir_before list dir_after

This should yield:
diff dir_before/aside_cls.list dir_after/aside_cls.list
39a40
> context_key
49a51
> index_dictionary
62a65
> usage_key
diff dir_before/aside_obj.list dir_after/aside_obj.list
42a43
> context_key
52a54
> index_dictionary
67a70
> usage_key
diff dir_before/block_cls.list dir_after/block_cls.list
0a1
> __annotations__
diff dir_before/block_obj.list dir_after/block_obj.list
0a1
> __annotations__

which indicates that:

XBlockAsides now have context_key, usage_key and index_dictionary attributes
XBlocks have a few type annotations now (more to come in #707 )
The list of attributes is otherwise unchanged

@ormsbee

Can you manually invoke the decorator on Blocklike after it's defined? I haven't done something like this in ages, but I think it'd be something like this?

Good idea. That bit of backwards incompatibility was making me a little nervous, so I'm glad to smooth it out. The syntax ended up being:
Blocklike.needs('field-data')(Blocklike)


Dimension documentation

Adds some documentation to the Dimension class. This should resolve #27

:+1: will merge if tests pass

@jb803 Can you hit the "update branch" button? Thanks.

Branch updated :)


Add Coveralls support.

Coveralls is added via OAUTH to my account.
Fixes #1116

The second commit is a live proof of code coverage :)
BTW I have set the limit to 85% but maybe we should set this is nyc.
Also, I don't know, do you guys have access to the Coveralls account? If not my guess is you'd need to login via GitHub, but I still don't know if you will have access to the Coveralls project settings. If not, it's a bummer, and generally I'm open to suggestions; I just went with Coveralls because I have used it in the past.

Oh, and the AppVeyor failures are valid, one of the POPs serves ungzip'ed files...


pull request for e2e test at 01/26/2017 19:15:11

:white_check_mark: Validation status: passed
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


New update makes server fail to start

my server says the mod is the reason its failing to start and its also putting files in places they shouldnt be.
https://paste.shockbyte.com/aduwazojaveqawopadif.  <--- start log

Use 2.12.0

I appreciate your work putting updates out but as of 2.14.1 the server still can't start. Is 2.12.0 still the stable version for servers?