text:
sqlserver用了with(nolock)后再加上order by排序就不行了

count报错

试试最新版本。

新版本支持了with(nolock) , 又不支持中括号[]了,
老版本支持中括号[], 又不支持with(nolock)
这可咋整呢

authors: abel533 majinding tlbgqq


text:
MyBatis 的mapper.xml中resultMap标签内配置了collection后多表关联分页查询总数据量与映射转换后对象总数据量不一致

Mapper.xml 内resultMap 配置如下
<resultMap id="baseResultMap" type="User">     <id property="id" column="id" />     <result property="loginName" column="login_name" />     <result property="name" column="name" />     <collection property="roleList" ofType="Role">         <id property="id" column="role.id" />         <result property="roleName" column="role.roleName"/>         <result property="roleEname" column="role.roleEname"/>     </collection> </resultMap> <select id="selectList" resultMap="baseResultMap">     SELECT         a.id,  a.login_name,  a.name,         f.id AS "role.id", f.role_name AS "role.roleName", f.role_ename AS "role.roleEname"     FROM 	tc_sys_user a     LEFT JOIN ( 	SELECT user_id, role_id  FROM  tc_sys_user_role 	WHERE 1=1 		AND user_id IS NOT NULL AND user_id !="" 		AND role_id IS NOT NULL AND role_id !=""     ) e ON e.user_id = a.id      LEFT JOIN tc_sys_role f ON f.id = e.role_id     WHERE  1=1 </select>
查询的总数是关联查询后的总记录数，主表User 表数据会出现重复记录，collection 标签归并部分数据后导致对象数据总量与 select count(SQL) tmp_count 的结果不一致，进而会出现每页的数据量比设置的pageSize数据量要少，分页的页面总数也不正常

 <collection property="resultDetailDTOList" ofType="com.cwag.pss.ipss.order.api.dto.trip.TransferFindByCardResultDetailDTO" column="order_id" select="groupForFindByCard"> </collection>
将collection中改成调用select方法，也就是将多关系的那部分提取出来，原本的sql里也不用加入多关系，就能成功使用

感谢了

source: gharchive/issue

repo: pagehelper/Mybatis-PageHelper

license: mit

license_type: permissive

license_source: bigquery


text:
/app/system after compiled by webpack, run error

Problem
webpack run success. webpack info:
C:\Bitnami\wamp\apps\pagekit\htdocs\app\system>webpack
Hash: e95943eda5d32c0ec761
Version: webpack 1.13.2
Child
    Hash: e95943eda5d32c0ec761
    Version: webpack 1.13.2
    Time: 2450ms
                  Asset    Size  Chunks             Chunk Names
    ./app/bundle/vue.js  168 kB       0  [emitted]  vue
       [0] ./app/vue.js 3.4 kB {0} [built]
       [1] ./app/lib/cache.js 662 bytes {0} [built]
       [2] ../assets/JSONStorage/storage.js 9.25 kB {0} [built]
       [3] ../assets/vue-form/dist/vue-form.common.js 14.5 kB {0} [built]
       [4] ../assets/vue-intl/dist/vue-intl.common.js 26.9 kB {0} [built]
       [5] ../assets/vue-resource/dist/vue-resource.common.js 34.5 kB {0} [built]
       [6] ./app/lib/asset.js 2.56 kB {0} [built]
       [7] ./app/lib/state.js 1.15 kB {0} [built]
       [8] ./app/lib/resourceCache.js 1.3 kB {0} [built]
       [9] ../assets/js-md5/js/md5.js 9.64 kB {0} [built]
      [10] ./app/lib/csrf.js 342 bytes {0} [built]
      [11] ./app/lib/notify.js 529 bytes {0} [built]
      [12] ./app/lib/trans.js 19.1 kB {0} [built]
      [13] ./app/lib/filters.js 609 bytes {0} [built]
      [36] ./app/directives/check-all.js 2.9 kB {0} [built]
      [37] ./app/directives/confirm.js 1.52 kB {0} [built]
      [38] ./app/directives/gravatar.js 3.31 kB {0} [built]
      [39] ./app/directives/order.js 1.32 kB {0} [built]
      [40] ./app/directives/lazy-background.js 242 bytes {0} [built]
      [41] ./app/directives/stack-margin.js 351 bytes {0} [built]
        + 22 hidden modules

but,pagekit isn't working correctly.
case: debug is not working .
page isn't loading correctly.
storage list isn't showing
by the way , my system is win10. when I execute “npm install” in root dir
there is a tips , fvsevent won't support it 。
Technical Details

Pagekit version: 1.0.8
Webserver:apache
Database:mysql
PHP Version:5.6

I would suggest to use the latest release package from our website: https://pagekit.com/download

repo: pagekit/pagekit


text:
🛑 School of intersession is down

In c432b36, School of intersession (https://www.schoolofintercession.eu) was down:

HTTP code: 0
Response time: 0 ms

Resolved: School of intersession is back up in 27162f9 after 1 hour, 17 minutes.

repo: pageon/uptime

license: MIT

license_source: github-api


text:
🛑 Every Nation Lisboa is down

In 4c5e2d1, Every Nation Lisboa (https://everynationlisboa.org) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Every Nation Lisboa is back up in ba8a9a0.


text:
buildpack.toml is missing

Until today my Spring Boot applications were successfully build. Today all my applications could not build anymore.
Expected Behavior
The build should be successful.
Current Behavior
The build failed with following error:
[INFO] --- spring-boot:3.1.3:build-image-no-fork (default) @ my-service ---
[WARNING]  Parameter 'imageName' (user property 'spring-boot.build-image.imageName') is read-only, must not be used in configuration
[WARNING]  Parameter 'publish' (user property 'spring-boot.build-image.publish') is read-only, must not be used in configuration
[INFO] Building image 'gitlab.mycomp.com:5005/group/subgroup/my-service:1351'
[INFO]
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder:base' 100%
[INFO]  > Pulled builder image 'paketobuildpacks/builder@sha256:17ea21162ba8c7717d3ead3ee3836a368aced7f02f2e59658e52029bd6d149e7'
[INFO]  > Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' 100%
[INFO]  > Pulled run image 'paketobuildpacks/run@sha256:1af9935d8987fd52b2266d288200c9482d1dd5529860bbf5bc2d248de1cb1a38'
[INFO]  > Pulling buildpack image 'gcr.io/paketo-buildpacks/adoptium:11.2.3' 100%
[INFO]  > Pulled buildpack image 'gcr.io/paketo-buildpacks/adoptium@sha256:c748c03a1d22adba9f5eaba450363f24de7db038c2d4d5e38997d44dfe9e9b99'
[INFO]  > Pulling buildpack image 'gcr.io/paketo-buildpacks/health-checker:latest' 100%
[INFO]  > Pulled buildpack image 'gcr.io/paketo-buildpacks/health-checker@sha256:ffbc1804adbed9c7c6849e10c55669728dbbc77baebcc432fd87a425ed1cc6bc'
[INFO]  > Executing lifecycle version v0.16.5
[INFO]  > Using build cache volume 'pack-cache-fbacccace87f.build'
[INFO]
[INFO]  > Running creator
[INFO]     [creator]     ===> ANALYZING
[INFO]     [creator]     Image with name "gitlab.mycomp.com:5005/group/subgroup/my-service:1351" not found
[INFO]     [creator]     ===> DETECTING
[INFO]     [creator]     ERROR: failed to initialize detector: open /cnb/buildpacks/paketo-buildpacks_adoptium/11.2.3/buildpack.toml: no such file or directory

Steps to Reproduce
My Spring Boot Maven Plugin configuration:
<configuration>
	<image>
		<env>
			<BP_SPRING_CLOUD_BINDINGS_DISABLED>true</BP_SPRING_CLOUD_BINDINGS_DISABLED>
			<BP_OCI_DESCRIPTION>${project.description}</BP_OCI_DESCRIPTION>
			<BP_OCI_VENDOR>${project.organization.name}</BP_OCI_VENDOR>
			<BP_OCI_CREATED>${maven.build.timestamp}</BP_OCI_CREATED>
			<BP_OCI_SOURCE>${CI_PROJECT_URL}</BP_OCI_SOURCE>
			<BP_OCI_REVISION>${CI_COMMIT_SHA}</BP_OCI_REVISION>
			<BP_HEALTH_CHECKER_ENABLED>true</BP_HEALTH_CHECKER_ENABLED>
			<THC_PORT>8081</THC_PORT>
			<THC_PATH>/health</THC_PATH>
		</env>
		<buildpacks>
			<buildpack>gcr.io/paketo-buildpacks/adoptium:11.2.3</buildpack>
			<buildpack>urn:cnb:builder:paketo-buildpacks/java</buildpack>
			<buildpack>gcr.io/paketo-buildpacks/health-checker:latest</buildpack>
		</buildpacks>
		<createdDate>${maven.build.timestamp}</createdDate>
	</image>
	<docker>
		<publishRegistry>
			<url>${docker.publishRegistry.url}</url>
			<username>${docker.publishRegistry.username}</username>
			<password>${docker.publishRegistry.password}</password>
		</publishRegistry>
	</docker>
</configuration>

Maven is executed on GitLab Runner with following job:
.build-java:
  image: maven:3.9.3-eclipse-temurin-17
  stage: build
  tags:
    - intern
  variables:
    MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN"
    MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version"
    GOAL: "package"
  script:
    - mvn $MAVEN_CLI_OPTS $GOAL $SONAR_PLUGIN
      -Dspring-boot.build-image.imageName=$CI_REGISTRY_IMAGE:$CI_PIPELINE_IID
      -Dspring-boot.build-image.publish=$PUBLISH
      -Ddocker.publishRegistry.username="$CI_REGISTRY_USER"
      -Ddocker.publishRegistry.password="$CI_REGISTRY_PASSWORD"
      -Ddocker.publishRegistry.url="$CI_REGISTRY"

I tried also with the latest version of gcr.io/paketo-buildpacks/adoptium, but this didn't fix the problem. Also I removed all images and volumes on the runner, but it didn't fix the problem either.
I also set BP_LOG_LEVEL with DEBUG, but I got no additional logs.

I tried this locally with both pack and Spring Boot build tools, and it works in both cases.
[INFO] --- spring-boot-maven-plugin:3.2.1:build-image (default-cli) @ demo ---
[INFO] Building image 'docker.io/library/demo:0.0.1-SNAPSHOT'
[INFO]
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-base:latest' 100%
[INFO]  > Pulled builder image 'paketobuildpacks/builder-jammy-base@sha256:92811b61280130099527b40c7650c871187a7e1cebb21744d93e480fc34cbcb0'
[INFO]  > Pulling run image 'docker.io/paketobuildpacks/run-jammy-base:latest' 100%
[INFO]  > Pulled run image 'paketobuildpacks/run-jammy-base@sha256:2cc8bb333754ccb35df8451471256c31cda09db6e4d16ee7503fb4f61ae83e98'
[INFO]  > Pulling buildpack image 'gcr.io/paketo-buildpacks/adoptium:11.2.3' 100%
[INFO]  > Pulled buildpack image 'gcr.io/paketo-buildpacks/adoptium@sha256:c748c03a1d22adba9f5eaba450363f24de7db038c2d4d5e38997d44dfe9e9b99'
[INFO]  > Pulling buildpack image 'gcr.io/paketo-buildpacks/health-checker:latest' 100%
[INFO]  > Pulled buildpack image 'gcr.io/paketo-buildpacks/health-checker@sha256:ffbc1804adbed9c7c6849e10c55669728dbbc77baebcc432fd87a425ed1cc6bc'
[INFO]  > Executing lifecycle version v0.18.4
[INFO]  > Using build cache volume 'pack-cache-5cbe5692dbc4.build'
[INFO]
[INFO]  > Running creator
[INFO]     [creator]     ===> ANALYZING
[INFO]     [creator]     Restoring data for SBOM from previous image
[INFO]     [creator]     ===> DETECTING
[INFO]     [creator]     9 of 28 buildpacks participating
[INFO]     [creator]     paketo-buildpacks/adoptium          11.2.3
[INFO]     [creator]     paketo-buildpacks/ca-certificates   3.6.7
[INFO]     [creator]     paketo-buildpacks/bellsoft-liberica 10.4.4
[INFO]     [creator]     paketo-buildpacks/syft              1.42.0
[INFO]     [creator]     paketo-buildpacks/executable-jar    6.8.3
[INFO]     [creator]     paketo-buildpacks/dist-zip          5.6.8
[INFO]     [creator]     paketo-buildpacks/spring-boot       5.27.8
[INFO]     [creator]     paketo-buildpacks/image-labels      4.5.5
[INFO]     [creator]     paketo-buildpacks/health-checker    1.10.0
[INFO]     [creator]     ===> RESTORING
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/adoptium:helper" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/adoptium:java-security-properties" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/adoptium:jre" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/syft:syft" from cache
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/spring-boot:web-application-type" from app image
[INFO]     [creator]     Restoring metadata for "paketo-buildpacks/health-checker:thc" from app image
[INFO]     [creator]     Restoring data for "paketo-buildpacks/syft:syft" from cache
[INFO]     [creator]     Restoring data for SBOM from cache
[INFO]     [creator]     ===> BUILDING
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Adoptium 11.2.3
[INFO]     [creator]       https://github.com/paketo-buildpacks/adoptium
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
[INFO]     [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
[INFO]     [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              17                                                           the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_DEBUG_ENABLED           false                                                        enables Java remote debugging support
[INFO]     [creator]         $BPL_DEBUG_PORT              8000                                                         configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false                                                        configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                                                                       write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        true                                                         enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary                                                      configure level of NMT, summary or detail
[INFO]     [creator]         $BPL_JFR_ARGS                                                                             configure custom Java Flight Recording (JFR) arguments
[INFO]     [creator]         $BPL_JFR_ENABLED             false                                                        enables Java Flight Recording (JFR)
[INFO]     [creator]         $BPL_JMX_ENABLED             false                                                        enables Java Management Extensions (JMX)
[INFO]     [creator]         $BPL_JMX_PORT                5000                                                         configure the JMX port
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0                                                            the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes                                               the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250                                                          the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                                                                        the JVM launch flags
[INFO]     [creator]         Using Java version 21 extracted from MANIFEST.MF
[INFO]     [creator]       Adoptium JRE 21.0.1: Contributing to layer
[INFO]     [creator]         Downloading from https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jre_x64_linux_hotspot_21.0.1_12.tar.gz
[INFO]     [creator]         Verifying checksum
[INFO]     [creator]         Expanding to /layers/paketo-buildpacks_adoptium/jre
[INFO]     [creator]         Adding 137 container CA certificates to JVM truststore
[INFO]     [creator]         Writing env.launch/BPI_APPLICATION_PATH.default
[INFO]     [creator]         Writing env.launch/BPI_JVM_CACERTS.default
[INFO]     [creator]         Writing env.launch/BPI_JVM_CLASS_COUNT.default
[INFO]     [creator]         Writing env.launch/BPI_JVM_SECURITY_PROVIDERS.default
[INFO]     [creator]         Writing env.launch/JAVA_HOME.default
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.append
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.delim
[INFO]     [creator]         Writing env.launch/MALLOC_ARENA_MAX.default
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/active-processor-count
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/java-opts
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/jvm-heap
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/link-local-dns
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/memory-calculator
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/security-providers-configurer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/jmx
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/jfr
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/openssl-certificate-loader
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/security-providers-classpath-9
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/debug-9
[INFO]     [creator]         Creating /layers/paketo-buildpacks_adoptium/helper/exec.d/nmt
[INFO]     [creator]       Java Security Properties: Contributing to layer
[INFO]     [creator]         Writing env.launch/JAVA_SECURITY_PROPERTIES.default
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.append
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.delim
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for CA Certificates 3.6.7
[INFO]     [creator]       https://github.com/paketo-buildpacks/ca-certificates
[INFO]     [creator]       Launch Helper: Reusing cached layer
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Syft 1.42.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/syft
[INFO]     [creator]         Downloading from https://github.com/anchore/syft/releases/download/v0.99.0/syft_0.99.0_linux_amd64.tar.gz
[INFO]     [creator]         Verifying checksum
[INFO]     [creator]         Writing env.build/SYFT_CHECK_FOR_APP_UPDATE.default
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Executable JAR 6.8.3
[INFO]     [creator]       https://github.com/paketo-buildpacks/executable-jar
[INFO]     [creator]       Class Path: Contributing to layer
[INFO]     [creator]         Writing env/CLASSPATH.delim
[INFO]     [creator]         Writing env/CLASSPATH.prepend
[INFO]     [creator]       Process types:
[INFO]     [creator]         executable-jar: java org.springframework.boot.loader.launch.JarLauncher (direct)
[INFO]     [creator]         task:           java org.springframework.boot.loader.launch.JarLauncher (direct)
[INFO]     [creator]         web:            java org.springframework.boot.loader.launch.JarLauncher (direct)
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Spring Boot 5.27.8
[INFO]     [creator]       https://github.com/paketo-buildpacks/spring-boot
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_SPRING_CLOUD_BINDINGS_DISABLED   true   whether to contribute Spring Boot cloud bindings support
[INFO]     [creator]         $BP_SPRING_CLOUD_BINDINGS_VERSION    1      default version of Spring Cloud Bindings library to contribute
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_SPRING_CLOUD_BINDINGS_DISABLED  false  whether to auto-configure Spring Boot environment properties from bindings
[INFO]     [creator]         $BPL_SPRING_CLOUD_BINDINGS_ENABLED   true   Deprecated - whether to auto-configure Spring Boot environment properties from bindings
[INFO]     [creator]       Creating slices from layers index
[INFO]     [creator]         dependencies (23.8 MB)
[INFO]     [creator]         spring-boot-loader (442.7 KB)
[INFO]     [creator]         snapshot-dependencies (0.0 B)
[INFO]     [creator]         application (42.6 KB)
[INFO]     [creator]       Web Application Type: Contributing to layer
[INFO]     [creator]         Reactive web application detected
[INFO]     [creator]         Writing env.launch/BPL_JVM_THREAD_COUNT.default
[INFO]     [creator]       4 application slices
[INFO]     [creator]       Image labels:
[INFO]     [creator]         org.opencontainers.image.title
[INFO]     [creator]         org.opencontainers.image.version
[INFO]     [creator]         org.springframework.boot.version
[INFO]     [creator]     Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>.
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Image Labels 4.5.5
[INFO]     [creator]       https://github.com/paketo-buildpacks/image-labels
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_IMAGE_LABELS                                     arbitrary image labels
[INFO]     [creator]         $BP_OCI_AUTHORS                                      the org.opencontainers.image.authors image label
[INFO]     [creator]         $BP_OCI_CREATED        2024-01-29T19:33:55Z          the org.opencontainers.image.created image label
[INFO]     [creator]         $BP_OCI_DESCRIPTION    Demo project for Spring Boot  the org.opencontainers.image.description image label
[INFO]     [creator]         $BP_OCI_DOCUMENTATION                                the org.opencontainers.image.documentation image label
[INFO]     [creator]         $BP_OCI_LICENSES                                     the org.opencontainers.image.licenses image label
[INFO]     [creator]         $BP_OCI_REF_NAME                                     the org.opencontainers.image.ref.name image label
[INFO]     [creator]         $BP_OCI_REVISION                                     the org.opencontainers.image.revision image label
[INFO]     [creator]         $BP_OCI_SOURCE                                       the org.opencontainers.image.source image label
[INFO]     [creator]         $BP_OCI_TITLE                                        the org.opencontainers.image.title image label
[INFO]     [creator]         $BP_OCI_URL                                          the org.opencontainers.image.url image label
[INFO]     [creator]         $BP_OCI_VENDOR                                       the org.opencontainers.image.vendor image label
[INFO]     [creator]         $BP_OCI_VERSION                                      the org.opencontainers.image.version image label
[INFO]     [creator]       Image labels:
[INFO]     [creator]         org.opencontainers.image.created
[INFO]     [creator]         org.opencontainers.image.description
[INFO]     [creator]         org.opencontainers.image.revision
[INFO]     [creator]         org.opencontainers.image.source
[INFO]     [creator]         org.opencontainers.image.vendor
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Health Checkers 1.10.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/health-checker
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_HEALTH_CHECKER_DEPENDENCY  thc   which health checker to contribute
[INFO]     [creator]         $BP_HEALTH_CHECKER_ENABLED     true  contributes a health checker if enabled
[INFO]     [creator]       Tiny Health Checker 0.19.0: Contributing to layer
[INFO]     [creator]         Downloading from https://github.com/dmikusa/tiny-health-checker/releases/download/v0.19.0/thc-x86_64-unknown-linux-musl
[INFO]     [creator]         Verifying checksum
[INFO]     [creator]         Copying from /tmp/c3dc05ec5e554f6e04aee577d8d56f16f8decf910ec121402d88ea04419b9183/thc-x86_64-unknown-linux-musl to /layers/paketo-buildpacks_health-checker/thc/bin
[INFO]     [creator]         Writing env.launch/health-check/THC_PATH.default
[INFO]     [creator]         Writing env.launch/health-check/THC_PORT.default
[INFO]     [creator]       Process types:
[INFO]     [creator]         health-check: thc (direct)
[INFO]     [creator]     ===> EXPORTING
[INFO]     [creator]     Adding layer 'paketo-buildpacks/adoptium:helper'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/adoptium:java-security-properties'
[INFO]     [creator]     Adding layer 'paketo-buildpacks/adoptium:jre'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/ca-certificates:helper'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/executable-jar:classpath'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/spring-boot:web-application-type'
[INFO]     [creator]     Reusing layer 'paketo-buildpacks/health-checker:thc'
[INFO]     [creator]     Adding layer 'buildpacksio/lifecycle:launch.sbom'
[INFO]     [creator]     Reusing 4/5 app layer(s)
[INFO]     [creator]     Adding 1/5 app layer(s)
[INFO]     [creator]     Reusing layer 'buildpacksio/lifecycle:launcher'
[INFO]     [creator]     Adding layer 'buildpacksio/lifecycle:config'
[INFO]     [creator]     Reusing layer 'buildpacksio/lifecycle:process-types'
[INFO]     [creator]     Adding label 'io.buildpacks.lifecycle.metadata'
[INFO]     [creator]     Adding label 'io.buildpacks.build.metadata'
[INFO]     [creator]     Adding label 'io.buildpacks.project.metadata'
[INFO]     [creator]     Adding label 'org.opencontainers.image.title'
[INFO]     [creator]     Adding label 'org.opencontainers.image.version'
[INFO]     [creator]     Adding label 'org.springframework.boot.version'
[INFO]     [creator]     Adding label 'org.opencontainers.image.created'
[INFO]     [creator]     Adding label 'org.opencontainers.image.description'
[INFO]     [creator]     Adding label 'org.opencontainers.image.revision'
[INFO]     [creator]     Adding label 'org.opencontainers.image.source'
[INFO]     [creator]     Adding label 'org.opencontainers.image.vendor'
[INFO]     [creator]     Setting default process type 'web'
[INFO]     [creator]     Saving docker.io/library/demo:0.0.1-SNAPSHOT...
[INFO]     [creator]     *** Images (9e2512d5e8c4):
[INFO]     [creator]           docker.io/library/demo:0.0.1-SNAPSHOT
[INFO]     [creator]     Reusing cache layer 'paketo-buildpacks/syft:syft'
[INFO]     [creator]     Reusing cache layer 'buildpacksio/lifecycle:cache.sbom'
[INFO]
[INFO] Successfully built image 'docker.io/library/demo:0.0.1-SNAPSHOT'

I'm not sure why it would fail in your case. I suspect something is either network or environment-related. Do you get the same hashes when you build?
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-base:latest' 100%
[INFO]  > Pulled builder image 'paketobuildpacks/builder-jammy-base@sha256:92811b61280130099527b40c7650c871187a7e1cebb21744d93e480fc34cbcb0'
[INFO]  > Pulling run image 'docker.io/paketobuildpacks/run-jammy-base:latest' 100%
[INFO]  > Pulled run image 'paketobuildpacks/run-jammy-base@sha256:2cc8bb333754ccb35df8451471256c31cda09db6e4d16ee7503fb4f61ae83e98'
[INFO]  > Pulling buildpack image 'gcr.io/paketo-buildpacks/adoptium:11.2.3' 100%
[INFO]  > Pulled buildpack image 'gcr.io/paketo-buildpacks/adoptium@sha256:c748c03a1d22adba9f5eaba450363f24de7db038c2d4d5e38997d44dfe9e9b99'
[INFO]  > Pulling buildpack image 'gcr.io/paketo-buildpacks/health-checker:latest' 100%
[INFO]  > Pulled buildpack image 'gcr.io/paketo-buildpacks/health-checker@sha256:ffbc1804adbed9c7c6849e10c55669728dbbc77baebcc432fd87a425ed1cc6bc'

What version of Docker is running on your Runner? Is it actually docker? Or Podman?

@dmikusa
Thanks for the fast anwser.
Additional information:

My company uses GitLab Community Edition v16.6.6.
The Docker version is Docker version 25.0.1, build 29cf629.
The Docker Host is mounted into the build container with linux socket. No DiD.

@dmikusa
For testing I removed:
<buildpacks>
	<buildpack>gcr.io/paketo-buildpacks/adoptium:11.2.3</buildpack>
	<buildpack>urn:cnb:builder:paketo-buildpacks/java</buildpack>
	<buildpack>gcr.io/paketo-buildpacks/health-checker:latest</buildpack>
</buildpacks>

Now the job succeeded, but I don't want to use the default JDK, I want to use Adoptium.

Oh, this sounds familiar. I want to say someone said this might be a Docker 25 issue. I haven't upgraded my Docker desktop yet, so that could be why it's still working for me. Are you able to downgrade Docker and test? Even just for testing purposes? Knowing would help narrow things down.

@dmikusa
That could be the reason. I looked into the machine and saw an update:
[root@gitlabrunner ~]# yum history info
[...]
Anfangszeit : Fri Jan 26 07:57:23 2024
[...]
    Aktualisiert  containerd.io-1.6.26-3.1.el7.x86_64           @docker-ce-stable
    Aktualisieren               1.6.27-3.1.el7.x86_64           @docker-ce-stable
    Aktualisiert  docker-buildx-plugin-0.11.2-1.el7.x86_64      @docker-ce-stable
    Aktualisieren                      0.12.1-1.el7.x86_64      @docker-ce-stable
    Aktualisiert  docker-ce-3:24.0.7-1.el7.x86_64               @docker-ce-stable
    Aktualisieren           3:25.0.1-1.el7.x86_64               @docker-ce-stable
    Aktualisiert  docker-ce-cli-1:24.0.7-1.el7.x86_64           @docker-ce-stable
    Aktualisieren               1:25.0.1-1.el7.x86_64           @docker-ce-stable
    Aktualisiert  docker-ce-rootless-extras-24.0.7-1.el7.x86_64 @docker-ce-stable
    Aktualisieren                           25.0.1-1.el7.x86_64 @docker-ce-stable
    Aktualisiert  docker-compose-plugin-2.21.0-1.el7.x86_64     @docker-ce-stable
    Aktualisieren                       2.24.2-1.el7.x86_64     @docker-ce-stable

I will try it tomorrow with a lower Docker version.

Maybe related to:
https://github.com/moby/moby/issues/47218

Hi,
same error here and I'm building with docker 25.0.2 version just upgraded few hours ago (unfortunately)
Thank you
f.

@dmikusa
FYI: We downgraded Docker to version 24 and it's working again. So I have to wait for Spring Boot 3.1.9. It will fix my problem.

Thanks for the upstream issue links and following up here. I'm going to close this issue out, since it's an upstream problem.

authors: dmikusa durcon fgapito

repo: paketo-buildpacks/adoptium


text:
Ruby Paketo Buildpack should support Puma apps

Background
Puma is a pretty popular Ruby web server, and it would be great if Paketo Buildpacks could support building apps that use Puma. I'm throwing this feature request into the MRI CNB repo as we don't have a language family Ruby repo just yet.
Notes:

See https://github.com/paketo-community/mri/issues/18 for a proposal for how we can support generic web server start commands

The implementation buildpack is getting PR'd in https://github.com/paketo-community/puma/pull/3.

PR has been merged

The puma buildpack has been auto-added to the dependencies list in the buildpack.toml: https://github.com/paketo-community/ruby/pull/14/files.
We still need another PR to added it to the order groups.

The PR to add the puma buildpack to the order group has been merged along with test coverage. We now have a release that includes puma: https://github.com/paketo-community/ruby/releases/tag/v0.0.1.

Looks great! I was able to build a ruby app using the puma web server and docker run it without providing a start command.
pack build puma-simple-app --buildpack gcr.io/paketo-community/ruby --builder gcr.io/paketo-buildpacks/builder:full-cf
full-cf: Pulling from paketo-buildpacks/builder
......................................
Digest: sha256:48f35d103139a5a4ec730d59c918504ecf7a573b9dd953036c2d9419834d3569
Status: Downloaded newer image for gcr.io/paketo-community/ruby:latest
===> DETECTING
paketo-community/mri            0.0.121
paketo-community/bundler        0.0.107
paketo-community/bundle-install 0.0.11
paketo-community/puma           0.0.3
===> ANALYZING
Previous image with name "index.docker.io/library/puma-simple-app:latest" not found
===> RESTORING
===> BUILDING
MRI Buildpack 0.0.121
  Resolving MRI version
    Candidate version sources (in priority order):
      <unknown> -> "*"
      <unknown> -> "*"

    Selected MRI version (using <unknown>): 2.7.1

  Executing build process
    Installing MRI 2.7.1
      Completed in 3.052s

  Configuring environment
    GEM_PATH -> "/home/vcap/.gem/ruby/2.7.0:/layers/paketo-community_mri/mri/lib/ruby/gems/2.7.0"

Bundler Buildpack 0.0.107
  Resolving Bundler version
    Candidate version sources (in priority order):
      Gemfile.lock -> "2.1.4"
      <unknown>    -> "*"
      <unknown>    -> "*"

    Selected Bundler version (using Gemfile.lock): 2.1.4

  Executing build process
    Installing Bundler 2.1.4
      Completed in 466ms

  Configuring environment
    GEM_PATH -> "$GEM_PATH:/layers/paketo-community_bundler/bundler"

Bundle Install Buildpack 0.0.11
  Executing build process
    Running 'bundle install'
      Completed in 11.181s

  Configuring environment
    BUNDLE_PATH -> "/layers/paketo-community_bundle-install/gems"

Puma Buildpack 0.0.3
  Writing start command
    bundle exec puma
===> EXPORTING
Adding layer 'launcher'
Adding layer 'paketo-community/mri:mri'
Adding layer 'paketo-community/bundler:bundler'
Adding layer 'paketo-community/bundle-install:gems'
Adding 1/1 app layer(s)
Adding layer 'config'
*** Images (948c45071915):
      index.docker.io/library/puma-simple-app:latest
Adding cache layer 'paketo-community/mri:mri'
Adding cache layer 'paketo-community/bundler:bundler'
Successfully built image puma-simple-app

docker run -e PORT=9292 -p 9292:9292 -it puma-simple-app
Puma starting in single mode...
* Version 4.3.5 (ruby 2.7.1-p83), codename: Mysterious Traveller
* Min threads: 0, max threads: 16
* Environment: development
Parsing options from the first comment line is deprecated!
* Listening on tcp://0.0.0.0:9292
Use Ctrl-C to stop
172.17.0.1 - - [03/Jun/2020:18:25:42 +0000] "GET / HTTP/1.1" 200 12 0.0083
172.17.0.1 - - [03/Jun/2020:18:25:42 +0000] "GET /favicon.ico HTTP/1.1" 404 469 0.0008
172.17.0.1 - - [03/Jun/2020:18:25:48 +0000] "GET / HTTP/1.1" 200 12 0.0008
^C- Gracefully stopping, waiting for requests to finish
=== puma shutdown: 2020-06-03 18:25:50 +0000 ===
- Goodbye!

Closing this.

authors: arjun024 kvedurmu ryanmoran

repo: paketo-community/ruby


text:
This PR absolutely improves the codebase.

PR details:

Uses Providers to manage state.
Uses stateless widgets to build UI, might change in the future (feature).
Adds the remaining UI part of the app, the Repos list of each User.
Simplified the codebase.
Got the app working.

Things to work on

[ ] Get the repo UI done.
[ ] Improve null case handling for providers.
[ ] Add more features from the Issues list

Also the list to work on has been moved to a milestone form.

source: gharchive/pull-request

repo: pal-codes/diggit


text:
no-switch-case-fall-through does not recognize block form of switch-case

Bug Report

TSLint version: 3.15.1
TypeScript version: 2.1.5
Running TSLint via: Visual Studio Code

TypeScript code being linted
  switch (action.type) {

    case actions.ON_AUTH_FORM_FIELD_CHANGE: {
      const {name, value} = action.payload;
      return state.setIn(['form', 'fields', name], value);
    }

    case actions.MAKE_TEMPORARY_USER_SUCCESS: {
      return state.update('ver', (ver: number) => ver + 1);
    }

    // snip

with tslint.json configuration:
"no-switch-case-fall-through": true

Actual behavior
TSLint complains about no-switch-case-fall-through, even though the previous case ends with return.
Even when I remove the return and add a break, it won't detect it.
When the curly brackets are removed, both return and break are recognized, and TSLint stops complaining
Expected behavior
TSLint should not complain whether or not the case: is followed by an explicit block.

this is a duplicate of #785
I'm currently rewriting some rules. This one will be the next and include bugfixes for all open bugs. Should be ready this weekend.

Interesting, I couldn't find it in the search. Thanks for pointing it out! I'm closing this, and will follow the other issue.

authors: MadaraUchiha ajafff

repo: palantir/tslint


text:
[Feature Request]: --print-config flag like eslint

I'm not using the issue template because I'm not reporting a bug and all the fields appear to relate to bug reporting. Please let me know if I can provide any other information.
Description
It would be great to have a way to audit the rules being applied to a given file or project, as eslint does with --print-config [FILENAME]. I've currently got a number of extends in my tslint.json and I'm getting unexpected results; being able to print the config would help. Ideally something like:
$ tslint --print-config path/to/file.ts

With the result being a simple JSON configuration of the evaluated set of rules.
Implementation
It looks like it might be pretty easy to accomplish, if I understand the library usage example properly—it seems like you'd just have to pretty-format the object returned by this command (assuming commandLineConfigArg?: string and commandLineFileArg: string were supplied through the command line):
tslint.Configuration.findConfiguration(commandLineConfigArg, commandLineFileArg).results

Is that a reasonable approach? In experimenting, I'm getting a pretty short set of rules compared to my eslint output on another project, so I might be missing something—ah it looks like the eslint output includes a lot of "off" rules, so I don't know how this flag might account for that. But if I understand the above line correctly, then in the short term I think I can just npx node and run these commands myself in a node console, but I think this would be a useful flag and help to align this tool with its ES analog.

Related: summary request at #2267. Perhaps these two could be accomplished together? Perhaps they shouldn't be?

Given the upcoming migration to ESLint (#4534), this seems like it would be a very useful configuration flag to help with migrating to typescript-eslint.
Marking as accepting PRs! 🎉
Since nobody piped up with an alternate proposal (☹), let's keep this as similar to ESLint's --print-config as possible. It should directly print out the JSON equivalent of whatever configuration is found.
$ eslint --print-config src/index.js
{
  "globals": {},
  "env": {},
  "rules": {
    "some-rule": 1
  },
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 2018,
    "sourceType": "module"
  }
}

authors: JoshuaKGoldberg bensaufley


text:
Bad documentation or JSON schema for no-duplicate-imports with allow-namespace-imports

Bug Report

TSLint version: 5.16.0
TypeScript version: 3.2.2
Running TSLint via: Visual Studio

TypeScript code being linted
The documentation for "Config examples" with no-duplicate-imports and allow-namespace-imports is incorrect...
{
  "rules": {
    "no-duplicate-imports": [true, {"allow-namespace-imports": true}]
  }
}

...should be...
{
  "rules": {
    "no-duplicate-imports": {
      "severity": "error",
      "options": {
        "allow-namespace-imports": true
      }
    }
  }
}

Here's what VSCode is saying...

Forgot to mention, this works, but still shows the incorrect schema warning...
{
  "rules": {
    "no-duplicate-imports": {
      "severity": "error",
      "options": {
        "allow-namespace-imports": true
      }
    }
  }
}

We don't maintain the JSON schema, that's on https://github.com/SchemaStore/schemastore
as per your original issue description... both options formats are actually supported. the first one is deprecated, while the second one is preferred. unfortunately the rule examples have not all been updated to reflect that (open to PRs).

☠ TSLint's time has come! ☠
TSLint is no longer accepting most feature requests per #4534. See typescript-eslint.io for the new, shiny way to lint your TypeScript code with ESLint. ✨
It was a pleasure open sourcing with you all!

🤖 Beep boop! 👉  TSLint is deprecated 👈 (#4534)  and you should switch to typescript-eslint! 🤖
🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋

authors: JoshuaKGoldberg adidahiya cruhl


text:
Can't use multiple Admin instances with different Bootstrap themes (FLASK_ADMIN_SWATCH)

❓  How can we use different Bootstrap themes through multiple Admin instances?
👨💻  This is how I tried to do it:
...
app.config['FLASK_ADMIN_SWATCH'] = 'cerulean'
admin1 = Admin(app, endpoint='admin1')
app.config['FLASK_ADMIN_SWATCH'] = 'cosmo'
admin2 = Admin(app, endpoint='admin2')
...

❌  But this does NOT work, I wrote this to clarify what I want to do with my issue.
Thanks!

If I solve, will PRs be viewed/merged soon?

This feels like a useful feature. I'm not sure yet how easy or hard it would be to support this, but if you've got ideas I'd be happy to hear them and would be willing to help review any PR you do put up. Would be good to understand your proposed approach first.

I had a look at this and it might be something we could get into the v2 release. Here's a possible approach: https://github.com/pallets-eco/flask-admin/pull/2462
As I've coded it, it's a breaking change. We could make this a bit softer and wrap the breaking change if we really wanted to - although since we're planning a v2.0.0 release, now's a fair time to get it in.

I actually already made the reslover changes for this, just needed to write the end of the example ) [the button that switches even the current theme]

@samuelhwilliams as I see you created a complete new configuration class for the Bootstrap options, while I used a new param to Admin which is bootswatch_theme. I think your approach also is awesome 👍

I'd love to see what you've done so far or what you're planning - if you've covered some use cases that I haven't, we can take the best of both :)

#2463

But mine is quite simple one. Your approach gives the project a seperate and full control over the theming. But there is a catch, you added also folder param, are we also going to plan to use different Bootstrap versions along along the different Admin instances?

But there is a catch, you added also folder param, are we also going to plan to use different Bootstrap versions along along the different Admin instances?

I don't think we need to. We might not even have to. But with my approach it becomes trivial to make it possible - and I think the more interesting idea is where someone has multiple admin instances for different groups of users. These could be user-provided template configs that point at their own private set of templates configured for each user group specifically. It feels fairly flexible without really costing us much.

I thought about this when I am making changes, but there were going to be more core changed needed to be done. I haven't really structured this feature in my head, but I think it requires the changes through the Boostrap template folders and some alternations when creating and registering the Blueprint from the base.

But there is a catch, you added also folder param, are we also going to plan to use different Bootstrap versions along along the different Admin instances?

I don't think we need to. We might not even have to. But with my approach it becomes trivial to make it possible - and I think the more interesting idea is where someone has multiple admin instances for different groups of users. These could be user-provided template configs that point at their own private set of templates configured for each user group specifically. It feels fairly flexible without really costing us much. Each admin instance can we styled exactly the way it wants/needs to be.

My guess is that when the users use multiple Admin instances, they might also want to use also different Bootstrap versions if need. But your reply sounds fair 👍

authors: princerb samuelhwilliams

repo: pallets-eco/flask-admin


text:
RuntimeError During Pytest Collection Because no App Context is Set Up Yet

Current Behavior
My application uses the factory method for setting up the application, so I use a pattern similar to the following:
# ./api/__init__.py

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

def create_app():
    app = Flask(__name__)
    db.init_app(app)

When collecting tests, pytest imports the test files as defined by in the pytest settings (in my case, the pytest.ini specifies that all test_* files in the directory ./tests are collected). During the collection, the test files are imported before any of the fixtures are set up. I have a file which defines a model which is subclassed from api.db.Model. My test makes use of this model by using sqlalchemy to scan the database to evaluate the precondition. Something like this:
from api.models import User

def it_creates_a_user(self, session):
    # GIVEN there is no existing user
    assert session.query(User).count() == 0

So when this file is imported, the api.models.__init__.py file is imported which, in turn, imports api.models.user.User which has a definition similar to the following:
from api import db

class User(db.Model):
    # columns

Again, when this import happens, pytest has not yet created the app fixture where I push the app_context, which means flask_sqlalchemy does not know which app the db is bound to and so it raises a RuntimeError:
RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.

This perplexed me greatly at first since I definitely am pushing an application context in my app fixture:
@pytest.fixture(scope="session", autouse=True)
def app():
    logger.info("Creating test application")
    test_app = create_app()
    with test_app.app_context():
        yield test_app

It wasn't until I thought to run pytest --continue-on-collection-errors that I found that the tests all run and pass just fine after the RuntimeError is raised during the collection phase. It was then that it dawned on me what the cause of the issue was. I have worked around this issue by pushing the context in my tests/__init__.py file:
# ./tests/__init__.py

from api import create_app

"""
This is a workaround for pytest collection of flask-sqlalchemy models.
When running tests, the first thing that pytest does is to collect the
tests by importing all the test files. If a test file imports a model,
as they will surely do, then the model tries to use the api.db before
the app has been created. Doing this makes flask-sqlalchemy raise a
RuntimeError saying that there is no application found. The following
code only exists to set the app context during test import to avoid
this RuntimeError. The tests will us the app fixture which sets up the
context and so this has no effect on the tests when they are run.
"""

app = create_app()
app.app_context().push()

This feels a little dirty and I'm hopeful that there is a way for this issue to be solved.
Relevant Code
# pyproject.toml

# Unrelated items

[tool.pytest.ini_options]
minversion = "6.0"
log_auto_indent = true
log_cli = true
log_cli_format = "%(levelname)-5.5s [%(name)s] %(message)s"
testpaths = ["tests"]
python_functions = ["test_*", "it_*"]

# api/__init__.py

import os
import shlex
import subprocess

from dotenv import load_dotenv
from flask import Flask
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()
ma = Marshmallow()

def create_app(test_config=None):
    app = Flask(__name__, instance_relative_config=True)

    if test_config is None:
        app.config.from_object(os.getenv("APP_SETTINGS"))
    else:
        app.config.from_mapping(test_config)

    db.init_app(app)
    ma.init_app(app)

    # a simple page that says hello
    @app.route("/health-check")
    def health_check():  # pragma: no cover
        cmd = "git describe --always"
        current_rev = subprocess.check_output(shlex.split(cmd)).strip()
        return current_rev

    return app

# ./app/models/__init__.py

from .user import User

# ./api/models/user.py

from uuid import uuid4

from sqlalchemy_utils import EmailType, UUIDType

from api import db

class User(db.Model):
    id = db.Column(UUIDType, primary_key=True, default=uuid4)
    email = db.Column(EmailType, nullable=False)

    def __repr__(self):
        return f"<User: {self.email}>"

# ./tests/unit/models/test_user.py

import logging

import pytest
import sqlalchemy

from api.models import User  # pytest imports this line before it sets up any fixtures

logger = logging.getLogger(__name__)

class TestUserModel:
    class TestNormalCase:
        def it_creates_a_user(self, session):
            # GIVEN No user exists in our database
            assert session.query(User).count() == 0

            # WHEN we add a new user
            test_user = User(email="test@testing.com")
            session.add(test_user)
            session.commit()

            # THEN the user is persisted in the database
            actual_user = session.query(User).get(test_user.id)
            assert actual_user == test_user
            assert repr(actual_user) == f"<User: {test_user.email}>"

    class TestErrorCase:
        def it_requires_a_user_email(self, session):
            with pytest.raises(sqlalchemy.exc.IntegrityError):
                test_user = User()
                session.add(test_user)
                session.commit()

# ./tests/conftest.py

# other stuff here, just showing that I am using the context in my app fixture

@pytest.fixture(scope="session", autouse=True)
def app():
    logger.info("Creating test application")
    test_app = create_app()
    with test_app.app_context():
        yield test_app

Environment:

Python version: 3.9.1
Flask-SQLAlchemy version: 2.4.4
SQLAlchemy version: 1.3.23

Sorry you ran into this confusing situation. However, there doesn't appear to be anything that this project should change.

authors: davidism mikelane

repo: pallets/flask-sqlalchemy


text:
make_response changes breaks custom response class

Expected Behavior
I should be able to return a single value from my view(that is, not a tuple) and have my value passed to my custom response class. In this case I have a response class that detects whether JSON or pickle data was requested by the client and dumps the return value appropriately. This allows me to simply return a list or dict from my view without having to detect and dump the appropriate type.
@mod.route('/')
def return_json_or_pickle():
    return ['foo', 'bar', 'bat']

As of Flask 0.12.2 this worked - make_response would pass the list to my custom response class and my client would get what it wanted.
Actual Behavior
As of 1.0, commit #2256 was merged which added an explicit check to see if the return value was a list; treating a list as a tuple return in that case. I now get a typeerror:
TypeError: The view function did not return a valid response tuple. The tuple must have the form (body, status, headers), (body, status), or (body, headers).

If I change my view function to return a tuple:
@mod.route('/')
def return_json_or_pickle():
    return ['foo', 'bar', 'bat'], 200

the previous functionality is restored! This confirms that tuple handling is of course perfectly fine. I have a pull request prepared which should do a very nice job of resolving the issue - it simply omits list from the type check in make_response. Since a list is not a valid response anyway, there's no reason I can see for it to be there.
Environment

Python version: 3.6
Flask version: 1.0
Werkzeug version: n/a

duplicate of #2726
Thinking about it, it seems fine to relax this and only assume tuples are responses. Can always do return make_resonse(list) if you need to handle a list.
As pointed out in the other issue though, subclassing and overriding Flask.make_response was the intended way to handle this.

It's ok, it made me rethink fixing it.

authors: davidism jesseops

repo: pallets/flask


text:
Update "test_number" to not return true on bool value

Hi!
When evaluating: isinstance(True, integer_types + (float, complex, decimal.Decimal)) returns True as bool is a subclass of int, so True is an instance of int.
Therefore my suggestion is to use the following instead: return type(value) in integer_types + (float, complex, decimal.Decimal)) which does return False when tested with a bool value but True if it belongs to the number types.
I hope this helps as I use Jinja2 on a daily basis,
Best regards,
Nico

Updated the test assertion at this pull request (https://github.com/pallets/jinja/pull/1076) to match this change
Best regards,
Nico

repo: pallets/jinja


text:
Adaptive scaling

thanks for implementing this! I'm still kind of a noob when it comes to the math behind diffusion models, but I know enough to be dangerous :P
Adaptive scaling is used in the diffusers pipeline implementation, though I don't see it mentioned in the paper. It seems like it adds a way to fade in the strength of the PAG effect.

Looks good, thanks! Though I think the default value for adaptive scale should be left at 0 (just like in the paper's demo).
I will merge it as it is and will make necessary changes in sd-forge part.

authors: dfl pamparamm

repo: pamparamm/sd-perturbed-attention


text:
Self-use version submission

Support sync the crates.io-index only.
Change crates.io-index path from {host}/git/crates.io-index to {host}/crates.io-index,
The home page url use config value in mirror.toml.
Fix url write error for crates download url. it's miss "/crates/" session after {host}.
Add some log output.

It include some no need changed. such as the source change to ustc. and docker change.

I'm sorry, this changes way too much. I appreciate the PR, but I'm going to have to reject this.

repo: panamax-rs/panamax


text:
MultiIndex dropped

Describe the bug
A clear and concise description of what the bug is.

[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandera.
[ ] (optional) I have confirmed this bug exists on the master branch of pandera.

Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
import pandera as pa
multi_index = pa.DataFrameSchema(
    columns={"test_col": pa.Column(int)},
    index=pa.MultiIndex([pa.Index(int, name="index_1"), pa.Index(int, name="index_2")]),
)
single_index = pa.DataFrameSchema(
    columns={"test_col": pa.Column(int)}, index=pa.Index(int, name="index_1")
)
print(multi_index)
print("-----")
print(single_index)
print("-----")
print("-----")
print(multi_index.reset_index())
print("-----")
print(single_index.reset_index())
# By contrast, this will work as expected:
print("-----")
print(multi_index.reset_index(["index_1", "index_2"]))

Expected behavior
The indices to become columns.
Actual behavior
The MultiIndex is completely dropped without being added to the columns.
Desktop (please complete the following information):

OS: Win10
Python 3.9.12

Screenshots

Additional context
Found in pandera-0.9.0
Exists as recently as pandera-0.11.0

thanks for finding this bug @plague006 !
I think the issue is here: https://github.com/pandera-dev/pandera/blob/master/pandera/schemas.py#L1585-L1587
The if levels is None then level_temp needs to be all of the names in the MultiIndex instead of an empty list.
Would you be open to making a PR to fix this issue? This test would also need to be updated to check for the case where level = None to make sure that they become columns as expected.

I would be happy to. Thanks for pointing me in the right direction. :)

repo: pandera-dev/pandera


text:
Add running additional filters in include-files.lua

I wanted to make PR to add functionality to run additional filter after the recursive transclusion.
-- recursive transclusion
contents = pandoc.walk_block(
  pandoc.Div(contents),
  { Header = update_last_level, CodeBlock = transclude }
  ).content

-- apply all filters if any
if filters then
  for i,f in ipairs(filters) do
    doc = pandoc.Pandoc(contents, metadata)
    contents = utils.run_json_filter(doc, "pandoc").blocks
  end
end

But I got stuck since it needs a more general run_filter function to run all sort of filters: See https://github.com/jgm/pandoc/issues/6830.
Can this be done, or is there another approach around.
Application: I want some filters to be run which affect the transclusion of include-files.lua. Namely replacing variables inside the include blocks
```{.include filter="codeblock-var-replace"}
${meta:chapterPath}/A.md
```

Here a potential workaround.
I'm using a 2 steps generation.

I run pandoc to create one complete md file
I use this file as source for normal generation with all my plugins

Here a potential workaround.
I'm using a 2 steps generation.

I run pandoc to create one complete md file
I use this file as source for normal generation with all my plugins

pandoc 3.1.2 solves this problem perfectly!

authors: St-Ex-savadenn gabyx wenbopeng

repo: pandoc/lua-filters


text:
Enable user

Description
Add method to enable/disable a given user.
While not in Grafana docs, methods for enabling and disabling can be found in the source code
Checklist

[x] The patch has appropriate test coverage
[x] The patch follows the style guidelines of this project
[x] The patch has appropriate comments, particularly in hard-to-understand areas
[ ] The documentation was updated corresponding to the patch
[x] I have performed a self-review of this patch

Dear Robert,
thanks a stack for your contribution.
With kind regards,
Andreas.

authors: amotl szuro

repo: panodata/grafana-client


text:
Treat .pth injected paths as extras.

Fixes #302
before:
[omerta pex (kwlzn/osxtras)]$ pex --version
pex 1.2.3
[omerta pex (kwlzn/osxtras)]$ pex six -o /tmp/six_broke.pex
[omerta pex (kwlzn/osxtras)]$ PEX_VERBOSE=9 PEX_PYTHON=/usr/bin/python /tmp/six_broke.pex
pex: Detected PEX_PYTHON, re-exec to /usr/bin/python
...
Python 2.7.10 (default, Jul 30 2016, 19:40:32)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from six import wraps
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: cannot import name wraps
>>> import six; six.__file__
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six.pyc'
>>>

after:
[omerta pex (kwlzn/osxtras)]$ tox -e py27-package
...
[omerta pex (kwlzn/osxtras)]$ ./dist/pex27 six -o /tmp/six.pex
...
[omerta pex (kwlzn/osxtras)]$ PEX_VERBOSE=9 PEX_PYTHON=/usr/bin/python /tmp/six.pex
pex: Detected PEX_PYTHON, re-exec to /usr/bin/python
...
pex: Found .pth file: /Library/Python/2.7/site-packages/Extras.pth
pex: Found site extra: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
pex: Found site extra: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC
...
pex: Tainted path element: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
pex: Tainted path element: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC
...
pex: Scrubbing from site-packages: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
pex: Scrubbing from site-packages: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC
...
Python 2.7.10 (default, Jul 30 2016, 19:40:32)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from six import wraps
>>> import six; six.__file__
'/Users/kwilson/.pex/install/six-1.10.0-py2.py3-none-any.whl.a99dfb27e60da3957f6667853b91ea52e173da0a/six-1.10.0-py2.py3-none-any.whl/six.pyc'
>>>

Yay! Thanks for fixing this. It was unbelievably irritating.

authors: benjyw kwlzn

repo: pantsbuild/pex


text:
Id xtoken

Security Checklist

[ ] 1. Re-Entrancy
[ ] 2. Arithmetic Over/Under Flows
[ ] 3. Unexpected Ether
[ ] 4. Delegatecall
[ ] 5. Default Visibilities
[ ] 6. Entropy Illusion
[ ] 7. External Contract Referencing
[ ] 8. Short Address/Parameter Attack (off chain)
[ ] 9. Unchecked CALL Return Values
[ ] 10. Race Conditions / Front Running
[ ] 11. Denial Of Service (DOS)
[ ] 12. Block Timestamp Manipulation
[ ] 13. Constructors with Care
[ ] 14. Uninitialized Storage Pointers
[ ] 15. Floating Points and Precision
[ ] 16. Tx.Origin Authentication
[ ] 17. Address.isContract Re-Entrancy via Constructor

⚠ NOTES ⚠
Make sure to think about each of these exploits in this PR.

could you also add NonReentrancyGuard for https://github.com/para-space/paraspace-core/blob/177486bc040369a55a5f98f1e360682778efee24/contracts/protocol/tokenization/NTokenUniswapV3.sol#L128

for

It's already added.

repo: para-space/paraspace-core


text:
--db <path> argument unintuitive in db subcommand

Describe the feature
reth db --db ../mainnet stats
is a bit weird, I'd expect that reth db stats --db <path> would work, but it doesn't
it's because of this:
https://github.com/paradigmxyz/reth/blob/d65cab9132e84e02e3e3bb7c5b04efce420ef663/bin/reth/src/db/mod.rs#L25-L36
I'd like to move the --db arg to the subcommands instead
wdyt @onbjerg
Additional context
No response

Just set global instead to avoid duplicating code.
https://docs.rs/clap/4.1.8/clap/builder/struct.Arg.html#method.global (outdated link because their docs broke on latest)

authors: mattsse onbjerg

repo: paradigmxyz/reth


text:
feat(discv5): open dns for discv5

To add a node to sigp/discv5, a signed node record is needed.
https://github.com/paradigmxyz/reth/blob/7efd5b09d210757ec9063acfd1904d372fb338d5/crates/net/network/src/discovery.rs#L210-L215
Alternative solutions: parse unsigned node record into libp2p Multiaddr type and request its ENR again. Why not use this solution? Since the dns service is already handling type Enr<SecretKey>, it's unnecessary to make the extra RTT to re-request the peer's ENR, before the peer can be used in a lookup query.
Sequel: Since dns/resolver already is generic over ENR key type, it makes sense to generalise the whole dns crate w.r.t. key type. This would save the extra work of encoding an Enr<SecretKey> and decoding it as an Enr<CombindeKey>, which is the type sigp/discv5 uses. Alt: address https://github.com/sigp/discv5/issues/233.

isn't the only thing we need a new enr field in the DnsNodeRecordUpdate?
so that we could also pipe the enrs to discv5 here:
https://github.com/paradigmxyz/reth/blob/28935daa9906326b0d7166a465b0f144b20fed1f/crates/net/network/src/discovery.rs#L210-L213

didn't want to break the public api of the crate, thoughts?

imo this would be a very simple change and gets us exactly what we want.
no concerns re breaking changes

imo this would be a very simple change and gets us exactly what we want.
no concerns re breaking changes

in that case I wouldn't strip the ENR of its signature at all, i.e. don't convert from [NodeRecord] type, it is only done to pass the token up to the app anyway. will this change be welcomed?

re-request review @mattsse @Rjected

authors: emhane mattsse


text:
Feasibility of using without Docker?

Hello!  I really like how SkiffOS is organized and am considering using it for a project.  I have a question: how feasible would it be to build images without docker as packaged software?  I am interested in using the layers management, which is really slick, without bundling Docker -- I have 32MB total storage on the board and I'd like to slim down to the very bare minimum.
I see that the SkiffOS core pulls in Docker, so is it "simply" a matter of writing a new base layer that does not require Docker?  Or is each layer automatically put into its own container (in other words, it's very deeply ingrained into the build process)?  If it's the former, I might request an officially-supported Docker-less base as a feature.
Thank you!

Very much doable. You can test this in a hacky way by deleting whatever you don't want in skiff/standard/buildroot/*. Just delete the lines related to Docker.
I have plans to onboard new container runtimes - cri-o, kata containers, and others, so it is about time that the Docker core get split into its own package and be made optional.

I've separated Docker into apps/docker in preparation for removing it as a dependency from skiff/standard.  Before this can happen there are some init scripts that need to check if Docker is enabled or not, but this is trivial and I'll complete that soon.

That's great to hear. I am definitely going to play with it more. I am not up to speed with it yet but ultimately if you want feedback on this I'll be watching with interest.

You can also add an additional layer with (in a file called buildroot/docker within the layer):
BR2_PACKAGE_DOCKER_ENGINE=n
BR2_PACKAGE_DOCKER_CONTAINERD=n
BR2_PACKAGE_RUNC=n

Oh cool, I didn't think about doing that. I'd prefer to avoid overriding a bunch of stuff in the long term (Yocto BSPs do this and it's very hard to read) but short term, it'll let me play around with changing the core.

You can overlay your own packages on top of it, and use Skiff as a submodule. It's described how in the readme.
If you add a custom config, and add the configuration lines I posted above in a buildroot config file, it will effectively disable Docker. You can also use this to add kernel config changes, additional buildroot packages, adjust the toolchain / optimization settings (you can optimize for size for example), etc etc.
cd workspaces/default
make menuconfig # opens the Buildroot config explorer

I've added an additional way to override the settings temporarily for local experimentation:
You can now simply place this file to disable docker:
$ cd SkiffOS
$ mkdir ./overrides/buildroot
$ echo "BR2_PACKAGE_DOCKER_ENGINE=n" > ./overrides/buildroot/docker
$ make configure compile

Etc, etc. You can place any Skiff configuration package files in "overrides" and override locally the settings.

Cool cool. My toolchain is compiling now.
Another question: Currently there is no way to override a Skiff-level layer dependency, correct?  I found your comment here suggesting that that was a planned feature.

Config negation would be cool and I might be able to get that in within the next couple days.

Would be cool, but don't rush it on my behalf!  I also feel like config negation would be the kind of thing you'd want to use really sparingly.  I can see how it'd be useful, but it could also make it very confusing to figure out what is actually getting compiled. So in this example, instead of the base layer providing Docker, each configuration package that provides a container would depend on apps/docker individually.
Does that make sense?  My caution is born of navigating override after override of Freescale's BSPs.

You can override dependencies as configurations later in the SKIFF_CONFIG comma separated chain take precedence. For example you could easily make a "nodocker" package that disables docker
I do plan to remove the apps/docker dependency from skiff/standard soon.

@thirtythreeforty This is about done.
There are a couple other things to save space: your target board config should support skiff/moduleimg, and you can additionally (although this is not yet in a config package) tell Skiff to mount a loop filesystem instead of loading the entire root system into RAM. This may be preferable if you don't have much memory.

Sweet.
moduleimg is cool, although currently I'm mounting squashfs rootfs on UBI (and the kernel knows how to mount, so no initrd), so moduleimg it doesn't buy me anything extra in this situation. I'm in a weird situation where the board has plenty of RAM (128MiB) but is tight on storage, so really just pulling Docker out of the base image should be enough.

This is done now as of https://github.com/paralin/SkiffOS/commit/0ee893202aa48fb20942c9f93c31c96d7a0a4313

Cool. core still appears to depend on apps/docker. Is that by design?

Yes. "Skiff core" refers to the feature that runs a docker container for each user. That's not required for an actual system. Skiff standard is applied automatically for that.

authors: paralin thirtythreeforty

repo: paralin/SkiffOS


text:
[Bug]: Sign up text in dark mode is not readable

🐞 Bug Report
📋 Description
"Sign Up" on Navbar is not readable in dark mode

Expected behaviour
The text color must be white

🐞 Bug Report
📋 Description
"Sign Up" on Navbar is not readable in dark mode
Expected behaviour
The text color must be white

Go and make the change. I don't think i can assign you any level but feel free to contribute.

sure

merged

repo: param-code/counter-app


text:
Create Omeda+IdentityX package w/rapid identify

Allows for “rapid identification” of an IdentityX user with Omeda. Once identified, the Omeda IDs are added to the IdentityX user as external entity IDs. Both the “standard” and “encrypted” IDs are applied.

 Omeda integration


text:
UX: HMW help people understand markers better

As a user I want to get hints on existing markers what they mean and how they are used so that I can use them correctly.
Description
When people see markers in the text they might not know what they mean, e.g. \ms.
Design a way to give hints e.g. on hovering over the marker or showing the backslash menu. Also design a way to link or show the usfm description from there.
observed in TC learning session

What is a "TC learning session"?
I would note that while this is a good idea should people be in the space of dealing with markers, the general plan in P10S is to allow users to get the results they want without having to learn anything about USFM or its markers.

tc = translation consultant
Yes, I agree that we want to have people use it without markers as much as possible. I assume there will be situations where they still have to check the markers (e.g. when the visual difference of representation is not clear enough) and others that are used to it, might want to look at markers - still they do not know all of them as we observed.

authors: Sebastian-ubs irahopkinson

repo: paranext/paranext-core


text:
DefaultSearchPlatform

How to do  defaultplatform to search, everytime  it search ytsearch, im disabled youtube search in lavalink but im idk how to disable it bot side.

make defaultPlatform: "scsearch"

and when you search track use spotify or scsearch

make defaultPlatform: "scsearch"

Can y can write code example to do that please?

Im maked Poru options defaultPlatform: "scsearch". But it searching yt and don't find any song because I disabled youtube search in lava link...

Solved that, thanks.

authors: JamesBondee parasop

repo: parasop/poru


text:
Add back links attribute

We cannot link twice to libusb anyway because of conflicting symbol names, so it doesn't make sense to remove this attribute.
Adding it back will allow using a local library override.

r? @debris @arkpar @andresilva (I don't know who to ping exactly

repo: paritytech/libusb-sys


text:
Fix contract instantiation weight

It turns out that https://github.com/paritytech/substrate/pull/10146 wasn't fixing the thing as I intended because I had the wrong assumptions. The weight for instantiate_with_code is actually correct to be that big because it includes the weight for loading the code into the sandbox which call forgoes.
👮♀👮♀👮♀ So the actual bug is that the weight of instantiate and call is too low 👮♀👮♀👮♀
After fixing this the weight of instantiate_with_code shouldn't look so high anymore in comparison because it saves the weight for loading the code into the sandbox which is now charged dynamically from the weight meter when  loading an existing code from storage (which does not happen in case of instantiate_with_code).

/benchmark runtime pallet pallet_contracts

/benchmark runtime pallet pallet_contracts

/benchmark runtime pallet pallet_contracts

/benchmark runtime pallet pallet_contracts

bot merge

bot merge force

repo: paritytech/substrate


text:
Upgrade trie-db crate to 0.16.0.

The new version of trie-db has some breaking API changes, but the node encoding format remains the same.

I guess trie-bench crate also need an update to new trie-db crate.

authors: cheme jimpo


text:
contracts: Remove state rent

This PR removes state rent (data, code) from the pallet_contracts code base. It greatly reduces complexity and allows coming changes to be much simpler to implement. It includes a storage migration and is backwards compatible for existing contracts (for the ones not using the unstable-interface feature). Tombstones are no longer a thing and existing ones are removed by the migration.
Motivation
The pallet_contracts was designed from the beginning to combat unbounded state growth by using state rent (charging contracts for the state they consume). The main reason for the introduction appears to be that this is what Ethereum was exploring at the time. The idea is elegant because it pushes the policy decisions around contract financing to the contract authors and allows them to experiment with different ideas rather than enforcing one at the runtime level.
In practice however, it turns out that state rent is really difficult to deal with and the smart contract audience is not equipped to deal with this issue and simply uses any other solution where this is not a thing. Please keep in mind that in contrast to runtime development where flexibility is key we are going for a crowd where ease of use is paramount. Additionally, Ethereum itself abandoned the idea and is on track on using what they call state expiry. Something that could be added to substrate later as a runtime opt-in for smart contract hosting chains.
The conclusion is that rolling out state rent will put us as a severe disadvantage with regard to adoption when compared to other smart contract technologies with regard to adaption without any short to medium time gain. Even on Ethereum with years of heavy usage on its back running a mining node is still something totally feasible. With the luxury of runtime upgrades and storage migrations we should solve the problem in a less intrusive way later.
Implementation
The PR mainly deletes code and adjusts tests/benchmarks. The biggest change is that the concept of a tombstone is gone. The TombstoneDeposit is renamed to ContractDeposit and is a deposit a deployer needs to deposit into the new contract on top of the ExistentialDeposit (no change to the previous behavior).  Please note that seal_terminate can still be used to remove a contract and is the only way to remove a contract and regain the deposit.
One side effect of this change is that the ContractInfo data structure no longer contains any mutable data. Meaning that all the data there is fixed at the point of contract instantiation. This makes the ContractInfo caching we do obsolete. Instead of deleting the code I hid it behind the CONTRACT_INFO_CAN_CHANGE constant which can be switched to true once we change the structure to contain mutable data again.
Security Discussion
With the removal of state rent we open the door for attackers that try to DoS the chain by creating as much storage as possible. This is because you pay once (in weight) to create the storage but it needs to be kept around forever by collators (in absence of a future solution like state expiry). The means of making this attack economically infeasible is to adjust the Limits::payload_len field which determines the maximum amount of storage per key. Lower sizes make creating storage more expensive because creating or updating storage items is expensive in weight. However, for maximum flexibility and efficiency we want to set the value as high as possible.
Please keep in mind that this attack would not affect the relay chain because validators do not need to keep the state of a potentially smart contract hosting parachain.
I propose setting the maximum value size per key to 512 bytes as an initial value (ethereum uses 32 bytes for various reasons). We can always increase the value but lowering it would be a breaking change. This would put the price of 1 GB of storage on Kusama to 271 KSM. Calculation here. Try to play around with different values. These are the weights obtained through benchmarking I used for the calculation (1ps = 1 weight = 1 unit of balance):
set_storage: "129.1 µs",
set_storage_per_byte: "851 ps"

Those values seem rather low but note that:

It gets more expensive when the chain is used more (price of the balance unit and balance price of weight)

The 1 weight = 1 balance unit is the worst case (cheapest case)

This is still above what 1GB would have costed on ethereum in 2017

Please keep in mind that we are not trying to find a long term solution due to these calculation but merely try to avoid a DoS attack.
Porting Guide
Smart Contract Languages
All existing stable functions are retained and are replaced by doing nothing or returning sane default values. The unstable seal_rent_params and seal_rent_status are removed.
Nodes
All rent related configuration options are removed from the Config trait. Remove them without replacement as your compiler requests. The public rent_projection function is removed and rent_projection field is removed from the return types of bare_instantiate and bare_call.
Offchain Tools
@jacogr
https://github.com/polkadot-js/api/issues/3925
The rent_projection RPC is removed and the rent_projection field is removed from the instantiate RPC result type. The in-storage ContractInfo type changed and need to be synced with typescript.

/benchmark runtime pallet pallet_contracts

Why not just charge a fixed deposit per stored byte? Charge storage by gas makes no sense nor does weights.

https://github.com/paritytech/substrate/issues/8671

Why not just charge a fixed deposit per stored byte?

The "just" is doing a lot of heavy lifting here, though. Making the caller pay a deposit is the obvious solution but it has some open questions associated with it. It is certainly something that we consider and it might be implemented. However, the code that is removed here can't be reused for that because it is all about the contract being responsible for paying the rent/deposit which is fundamentally different.

Charge storage by gas makes no sense nor does weights.

I agree. But that is not the point. I stated in my write up that those calculations are just to assess how feasible a DoS attack is right now. It is not a long term solution.

/benchmark runtime pallet pallet_contracts

/benchmark runtime pallet pallet_contracts

/benchmark runtime pallet pallet_contracts

/benchmark runtime pallet pallet_contracts

All the weights increased substantially which is not due to changes in this PR. Some changes where made to the bot. Holding of merge until this is resolved: https://github.com/paritytech/substrate/pull/9675

/benchmark runtime pallet pallet_contracts

bot merge

hey, this pr will be merged soon, so why not recover put_code call? without rent, the code can be upload direclty, this is important for multi-contracts project.

It is not that easy. The uploaded code is still refcounted and removed when the last contract using it is removed. Without this there is no way to remove unused contracts. This can be changed but I don't want to do this in this removal only PR. I can do it as a follow up.

/benchmark runtime pallet pallet_contracts

bot merge

authors: atenjin athei joao-paulo-parity xlc


text:
unsigned trx

Hi Guys
I have question regarding create trx:
when I want to make unsigned trx with 'methods.balances.transferKeepAlive' I need some property like genesisHash,
metadataRpc ,... that I should fetch them from node and it takes time, This time may be longer than 5 seconds and we can not send the transaction in the current block, how can we make sure that the transaction will send in the current block.
thanks in advance

Hey @regazeri,
Question: What is the idea behind including a transaction at the block it was constructed at? Also, what are you using the fetch the information, and are you querying a public node or local one?
The idea being that a transaction is valid for future blocks that contain the same runtimeVersion, so you shouldn't have to get it in the same block. When submitting a transaction there is also no guarantee that the block author will include it at that block, or that it will gossiped to the block author in time.

thanks for your comment, it was helpful.

authors: TarikGul regazeri

repo: paritytech/txwrapper-core


text:
Admin Feature Request - Editing Cues

Via Scott Fletcher - Can we develop an easy way for me to go through and quickly insert some editing 'cues' (eg. the 'broom' icon for "this section needs to be cleaned up" or 'citation needed' etc.)? Wikipedia actually offers all their editing scripts which I had a look through https://en.wikipedia.org/wiki/Wikipedia:Tools/Editing_tools
A lot of them are super simple and definitely applicable to PPedia. For example, the ability to add a note at the end of a sentence that says "awkward phrasing" (in exponential form)
via Pat - We need to discuss whether and how to create this type of editorial community https://medium.com/matter/the-36-people-who-run-wikipedia-21ecca70bcca

Unnecessary

authors: jesicarson scottofletcher

repo: participedia/frontend


text:
pubKeyCredParams[n].alg serialization issues

After upgrading Fido2 from 1.1.0 to anything 2.0.0 or above we're seeing an incorrect serialization of the publicKeyCredParams[n].alg values.  I've seen some things about the type being serialized incorrectly to a number, but cannot find anything about the alg being serialized incorrectly as a string.  I also noticed there were some changes to the alg to move it from a long to an enum.
New lib error:

New:

Old:

I can't reproduce this.  The strings coming out of the alg values are weird enough, but the dashes that are getting added in the middle are really bizarre.  Not really sure where that is coming from.

With this change, We are unable to call navigator.credentials.create. Exception occurs. The same code works with Nuget Package 1.1.0 where the pubKeyCredParams[n] is hardcoded.

@Binaryraja Were you able to figure this out?

authors: Binaryraja StummeJ aseigler iamcarbon


text:
Update dependancies for Masonry and Angular

Can we update the bower package dependancies for Angular to include 1.4? I saw a pull request for this was closed, but when I change it to 1.4.0 it works with no issues.

Yes, would you be interested in submitting a pull request for that update?

I'm wondering why nobody ended up doing that, as it seems toi only require bumping the required version in bower.json.
If I heve a go at it and check all tests are passing, do you think I can get a pull request accepted and a new version released rapidly?

@vrouet Yup, I think so. :)

authors: passy tjshipe vrouet

repo: passy/angular-masonry


text:
Ways to contribute?

Sorry if this is the wrong place to put this, but what kinds of tasks need to get done to move this project forward?  I'm very interested in seeing DeskGap take off, so I'd love to help any way I can.

Hi, sorry for the late reply. I've been focusing on the Linux support.
I just posted some help-wanted issues for kind guys like you to look around.


text:
jitting a module with segment sums

Hello; I am new to equinox and the jax ecosystem, so apologies if this is a trivial question, but I am having some difficulty in sorting it out:
I have written an eqx.Module and would like to use jit in its training; the problem is the module has several spots where ops.segment_sum are used. According to jax documentation this is ok, provided one can make the num_segments argument to segment_sum static (by which I interpret constant throughout all samples in the dataset). I have done this by constructing batches of samples in such a way that the num_segments argument is indeed the same for every batch. However, when decorating my training step function with @eqx.filter_jit it is slower than not jitting at all, and I suspect that this is because jit is recompiling every time because it is assuming that num_segments changes from batch to batch, when it does not.
I guess I need to declare those num_segment values as static somewhere, perhaps as an option to @eqx.filter_jit, but I have not found how to do it; can someone point me in the right direction? Thanks!
And while I am at it: is there a way to confirm that jit is recompiling at every step? At present this is my impression (I was expecting my jitted code to be much faster than the unjitted), but I am not 100% sure.
Thank you in advance for any hints received!

Welcome to JAX and Equinox! :)
You can check recompilations using eqx.debug.assert_max_traces.. This will also give you which argument caused recompilations.
Note that recompilation is triggered by passing new static arguments (non-arrays) through eqx.filter_jit, or by changing the shape/dtype of the arrays passed to eqx.filter_jit. It is not triggered by changes in segment_sum. Instead, if a traced (non-static) argument is passed to segment_sum then it should simply raise an error during compilation.
As such you should be able to isolate the cause of recompilations solely by checking what is passed across the JIT boundary :) (e.g. using eqx.debug.assert_max_traces or by any other means)
I hope that helps!

Thanks for your response. By reading more thoroughly your excellent documentation I had found out about eqz.debug.assert_max_traces, so I can confirm that indeed there were recompilations happening, and I assumed this was due to the segment_sums in my model because jax documentation says that to jit a segment_sum one must ensure that the num_segments does not change; so I have been chasing a red herring? It surprises me that the suspects are passing new static arguments or changing shapes/dtypes, as you suggest, but I will make sure of this. Thanks again!

Sorry! Me again!
When you say "Note that recompilation is triggered by passing new static arguments (non-arrays) through eqx.filter_jit", do I interpret this correctly to mean that the arguments have to be arrays? A dict is not allowed? I am certainly passing a number of book-keeping arrays, but bundled up in a dictionary; the sizes and shapes of those book keeping arrays are the same from sample to sample, but their values inevitably change. But that shouldn't trigger recompilation, should it?

Hi Eduardo, Hi Patrick,
a dictionary with arrays is a PyTree of Arrays, this should not be a problem. However, it is important that the numbers in your dictionary are actually wrapped in arrays, like so:
import equinox as eqx
import jax.numpy as jnp
from jaxtyping import Array, PyTree

@eqx.filter_jit
@eqx.debug.assert_max_traces(max_traces=1)
def some_function(x: Array, book: PyTree[Array]) -> tuple[Array, PyTree[Array]]:
    y = 2 * x
    book['a'] += 1
    return y, book

x = jnp.linspace(0, 1, 10)

dict_of_arrays = {'a': jnp.array(1), 'b': jnp.array(2)}
dict_of_numbers = {'a': 1, 'b': 2}

for _ in range(2):
    y, dict_of_arrays = some_function(x, dict_of_arrays)

for _ in range(2):
    y, dict_of_numbers = some_function(x, dict_of_numbers)
``

Note that passing a dictionary of numbers will trigger recompilation.

Thank you @johannahaffner for your feedback. Indeed at least one of the items in my dict of indices was itself a dict of numbers; I was not aware that this would trigger recompilation, so I have changed following your remarks. I think I am closing in on the solution thanks to your and @patrick-kidger's comments, but my problem still persists; I need to try a little harder.
Specifically, my application is a graph neural network, and more specifically a graph regression. I batch my graphs together so that all the batches have exactly the same total number of nodes and the same total number of edges (I did this thinking it would help with segment_sums, although according to @patrick-kidger this is not the issue). However there remain other book-keeping indices, to track which node sends messages to which other nodes (an same for edges) that cannot easily be made of the same size, as these depend on each graph's particular pattern of connections. I suspect the problem may lie here. Could this be it?
Thanks again to you both for your helpful comments.

That sounds like it could be it!
Can you work with padded arrays? This means adding zeros to your arrays, such that they all have the same shape. For your graphs, you could cast them all to the same shape by adding unconnected nodes.

This I did already (padding with zeros) with the node and edge features so as to make sure that each batch (a graph composed of multiple graphs) had the same total number of nodes and edges; I am not sure if I can do the same with the book-keeping indices, but I will give it a good try. Thank you so much!

I'm sure there's a way around it, though.

Great!

repo: patrick-kidger/equinox


text:
Investigate PurgeCSS for optimizing CSS

Doesn't look too hard:
https://purgecss.com/guides/next.html#customize-postcss-configuration-next-js-9-3
https://dev.to/thomasledoux1/shipping-minimal-css-with-next-js-bootstrap-3mdi
What kind of savings would we see on existing projects?

My experience with larger next.config.js changes like this (like basic scss support before Next added it to core) from we first started with next.js is that they make updates to new versions very difficult. Next makes a lot of babel and webpack changes behind the scenes which tend to conflict. The per-project savings should be compared with difficulty of getting upstream next.js versions loaded which could offer various other compelling perf savings.
Getting existing projects on the latest next.js code would offer performance upgrades, and exploring dynamic imports for flex modules like we discussed in slack recently could also similar benefits

I agree with you on ease of upgrades being a consideration, and that a custom postcss config is harder to upgrade.
On the other hand, I'd say this article made a good case for the value in CSS purge:
https://papyrus.dev/@PapyrusBlog/how-we-reduced-next.js-page-size-by-3.5x-and-achieved-a-98-lighthouse-score
I'd like to at least try it and see what the benefits are so we can compare.

Looks like this is being closer to a part of Next:
https://twitter.com/hdjirdeh/status/1369709676271726599?lang=en

authors: ccorda kylehotchkiss

repo: patronage/bubs-next


text:
Fix zone for GCK

Found in chat...should have been NA

Fixed in 81c1ed9deea38279ac723355b6b65cc3ef7a9ec6

repo: patsonluk/airline


text:
Override _data.json in template

Hi and thanks for an awesome project.
Im having an issue where i cant seem to override some data:
I have the following molecule ( 00-progress-bar.mustache ):

      {{ progress-bar.percent }}% Complete

with the following set in _data.json:
{
    "progress-bar" : {
        "percent": "90",
        "bg-color": "",
        "color": ""
    }
}
This renders perfect on the molecule though when trying to override the data in template ( e.g. 00-basic-template.mustache ), I get no result - the molucule just uses the _data.json and not the data set in, e.g. 00-basic-template.json
In the example above, my 00-basic-template.json looks like:
{
    "progress-bar" : {
        "percent": "90",
        "bg-color": "",
        "color": ""
    }
}`
It what im trying to do possible?
Also, say I had included {{> molecules-progress-bar }} twice within 00-basic-template.mustache and I wanted the bg-color to differ, how would I pass 2 different bg colors to the seperate {{> molecules-progress-bar }} ?
Thanks again.

@CharlJKruger -
A quick test worked for me so I'm not sure what's going on. I did note that your example data in _data.json is exactly the same as 00-basic-template.json. Maybe that's the cause?
To pass different colors you're going to have to use pattern parameters.

Another way to pass different colors, is to wrap your includes with a section block, so that your mustache file looks like this:
{{# section }}
  {{> molecules-progress-bar }}
{{/ section }}

And your 00-basic-template.json:
{
  "section": [
    {
      "progress-bar" : {
        "percent": "90",
        "bg-color": "#fff",
        "color": "#000"
      }
    },
    {
      "progress-bar" : {
        "percent": "60",
        "bg-color": "#000",
        "color": "#fff"
      }
    }
  ]
}

#section is an array with two node, which means the progress-bar molecule will be rendered two times, once with the values of the first node and then with the values of the second node. This should also override the values in _data.json (though, as @dmolsen mentioned, they should have also been overridden by the example you provided).

I have to remember that trick, @TxHawks . Nice :)

Happy to be of service.

@TxHawks that's exactly what I was trying to do, thanks to all. Will also use the pattern parameters for some testing and so forth.

@CharlJKruger just keep in mind that while pattern parameters can be very helpful, they are not real mustache, and cannot be overridden by json files

Since this was answered I'm closing it up.

authors: CharlJKruger TxHawks dmolsen

repo: pattern-lab/patternlab-php


text:
feat(table): add support for borders in compact table

fixes https://github.com/patternfly/patternfly-next/issues/1540

Deploy preview for pf-next ready!
Built with commit aee793e5a8fa7dd5342d6c4cb01cc174112e886c
https://deploy-preview-1541--pf-next.netlify.com

@srambach @mceledonia updated to remove the extra top padding when the compact table has borders.

:tada: This PR is included in version 1.0.238 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

authors: mcoker patternfly-build

repo: patternfly/patternfly-next


text:
fix(table): fix disappearing borders in firefox, workspace styles

fixes https://github.com/patternfly/patternfly-next/issues/1520
You'll need to test in Firefox on windows to verify the borders no longer disappear. Also updated a bunch of workspace styles so they don't bleed into the examples.

Deploy preview for pf-next ready!
Built with commit dd54c16b675e6629813d0eb5125e20248db0da54
https://deploy-preview-1545--pf-next.netlify.com

Strange, in this PR i still see those two issues that I had fixed in recent PRs:

@christiemolloy I rebased, let me know if you still see those issues.

@mcoker not seeing those issues anymore

:tada: This PR is included in version 1.0.234 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

authors: christiemolloy mcoker patternfly-build


text:
Relax the highline dependency to allow version 3 and higher

To address #61
I looked at the HighLine release notes for versions 3+, and I think it's all bug fixes and internal refactoring. Looks safe to me & tests pass locally, but please look carefully (I am no expert at ProgressBar or HighLine)

Thanks for the fix! Looks like the actions need some love, too. I'll take a look.

I updated the build matrix in #63, which ran into the same problem, so I fixed it over there, too. Thanks for the fix!

Released 1.3.4.

authors: dgholz paul

license: WTFPL


text:
Unable to mock WSRequestHolder.get()

I'm trying to test the following line of code using ScalaTest and ScalaMock.
val responseFuture = wsClient.url(url).withQueryString(params: _*).get()

wsClient type is THttpClient, which is a wrapper of play.api.libs.ws.WS.
Given that:
val mockHttpClient = mock[THttpClient]

is properly injected into my class under test, the test code is something like this:
val expectedUrl = "some url"
val mockRequestHolder = mock[WSRequestHolder]
inSequence {
  (mockHttpClient.url _).expects(expectedUrl).returns(mockRequestHolder)
  (mockRequestHolder.withQueryString _).expects(where {
    (parameters: Seq[(String, String)]) => {
      // assertions on parameters
      // ...
      true
    }
  }).returns(mockRequestHolder)

  val stubResponse = stub[WSResponse]
  val jsonBody = "{}"
  (stubResponse.json _).when().returns(Json.parse(jsonBody))
  (mockRequestHolder.get _).expects().returns(Future(stubResponse))
}

IntelliJ is highlighting mockRequestHolder.get as an error saying: cannot resolve symbol get. Nevertheless I'm able to run the test but the mock is clearly not working, and I'm getting: java.util.NoSuchElementException: JsError.get.
The mock is working when I try to mock any other method of WSRequestHolder, but not with method get.

apologies that this has been sitting in the queue for so long.
Could you confirm if you are still interested in this issue?
Also, can you check the return types? It seems WSRequestHolder.get returns F.Promise<WS.Response>, not Future

authors: PaoloBoniNektan barkhorn

repo: paulbutcher/ScalaMock


text:
Update sbt-sonatype to 3.9.6

Updates org.xerial.sbt:sbt-sonatype from 3.9.5 to 3.9.6.
GitHub Release Notes - Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.xerial.sbt", artifactId = "sbt-sonatype" } ]

labels: sbt-plugin-update, semver-patch

Superseded by #384.


text:
Re-enable Unit Tests

As per https://github.com/paulcbetts/punchclock/pull/16#issuecomment-244053527 we have had to disable them until ReactiveUI v7 ships https://github.com/reactiveui/ReactiveUI/pull/850 due to circular dependencies.

RxUI v7 will not be netstandard; this is now blocked to RxUI v8

repo: paulcbetts/punchclock