Spread out Integrity Checks across all 7 days of week

Several of my clients have large databases that need to have their own integrity check job.  If we ran the integrity checks against all databases, it would run for longer than a day.
I've written some code that wraps the EXEC dbo.DataqbaseIntegrityCheck.  It assigns each database a day of the week to run order by size, then tries to have the largest databases run on the weekends.
If the code is deemed desireable, I can integrate into the job setup scripts.
DECLARE @date DATE = DATEADD(DAY,0,GETDATE())
DECLARE @dayOfWeek INT = DATEPART(WEEKDAY,@date)
DECLARE @databaseNames VARCHAR(1000)

;WITH cte AS (
	--Let's break down this query
		--We first order the databases based on size.  That way we try to prevent the largest sizes from being assigned the same day.
		--We then want to perform a modulus (also called mod or remainder) function, so we can easily assign each database a day of the week.
		--Howerver, we add 4 to it, on the inside of the modulus, to manipulate getting the largest database to run Friday night.  This should be 1 + 5 = 6, but we are adding one on the outside, so just 4.
		--Finally, we have to add 1 after all of that to make it 1 based, rather than 0 based.  There is no 0 day of week.

DECLARE @date DATE = GETDATE();
DECLARE @dayOfWeek INT = DATEPART(WEEKDAY,@date);
DECLARE @databaseNames NVARCHAR(1000) = null;

WITH cte AS (
	/*We first order the databases based on size to prevent the largest sizes from being assigned the same day.*/
	/*We then want to perform a modulus function, so we can assign each database a day of the week.*/
	/*However, we add 4 to it, on the inside of the modulus to manipulate getting the largest database to run Friday night. This should be 1 + 5 = 6, but we are adding one on the outside, so just 4.*/
	/*Finally, we have to add 1 to make it 1 based.*/
	SELECT
		quotename(d.[name]) [name],
		((ROW_NUMBER() OVER(ORDER BY SUM(f.[size]) DESC) + 4) % 7) + 1 [DayOfWeekAssigned]
	FROM sys.databases d
	JOIN sys.master_files f ON d.[database_id] = f.[database_id]
	WHERE NOT d.[name] IN (N'master', N'model', N'msdb', N'tempdb', N'distribution')
	GROUP BY d.[name]
)
SELECT @databaseNames = string_agg(cte.[name], ',')
FROM cte
WHERE cte.[DayOfWeekAssigned] = @dayOfWeek;

IF @databaseNames IS NOT NULL EXECUTE [dbo].[DatabaseIntegrityCheck] @Databases = @databaseNames, @LogToTable = 'Y';


Update emacs.md with a guide for Monroe and xwidget brower

Following from this Slack thread - I've added a short guide on how to launch Portal within Emacs when using Monroe nREPL client

I'm looking into making this code a bit better, but got blocked by me not quite understanding of Monroe's internals: https://github.com/sanel/monroe/issues/46

@djblue Updated! I finally had some time to figure out how to make this work without writing files etc. Let me know if you have any other suggestions 👍

Awesome, thanks for the contribution!


FileNotFoundError: [Errno 2] No such file or directory: 'data/BEAT/beat_cache/beat_4english_15_141/weights/GesAxisAngle_Face_300.bin'

The "GesAxisAngle_Face_300.bin" is an autoencoder checkpoint for computing the Frechet Distance metrics. I will upload the autoencoder checkpoints later. You can temporally comment them out without computing Frechet Distance metrics during training.

Please kindly refer to https://github.com/JeremyCJM/DiffSHEG/issues/1#issuecomment-2073909211 and https://github.com/JeremyCJM/DiffSHEG/issues/2#issuecomment-2085595280.


⚠ ClamAV has degraded performance

In 8742740, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 378 ms

Resolved: ClamAV performance has improved in 2dfb519.


Functions for Integer sign and unsign are missing

https://github.com/riscv-software-src/riscv-isac/blob/9dc9503c9cce79d8c93d8f4955111f2f6d1ad9c7/riscv_isac/InstructionObject.py#L285
For rs3 the functions has to be defined with respect to sign and unsigned values.

There aren't any 3 operand integer instructions currently. Closing this as it is irrelevant with the current state of support.


Add a prefix to files output to ${FLUTTER_LOGS_DIR}

I unfortunately misunderstood how ${FLUTTER_LOGS_DIR} works, and have been overwriting my own outputs 😢:

Any task in the same builder writes to the same directory
If task A writes foo.txt, and task B writes foo.txt, then task A's foo.txt is silently overwritten.

Re-runs (i.e. due to failures or timeouts) have the same property
If task A (run 1) fails, a successful task A (run 1) will overwrite the logs of the failed entry.

This is all made extra confusing by the fact the UI shows multiple log uploads, as if they might be different:

Special thanks to @keyonghan for explaining this all to me here on Discord.

If you do that generically in https://github.com/flutter/flutter/blob/ab4bf7c1c91533964ceb71c6506a31100981e238/dev/devicelab/lib/framework/host_agent.dart places that already add timestamps can be removed:
https://github.com/flutter/flutter/blob/ab4bf7c1c91533964ceb71c6506a31100981e238/dev/devicelab/lib/framework/ios.dart#L229
There are other spots we're likely overriding files: https://github.com/flutter/flutter/blob/ab4bf7c1c91533964ceb71c6506a31100981e238/dev/devicelab/lib/tasks/perf_tests.dart#L1053-L1055

To be clear this is in flutter/engine where we don't have access to flutter/dev.

Oh, right, sorry for the noise 🙂

I appreciate your noise.


[REF] replace openerp.py by manifest.py and openerp by odoo

[REF] replace openerp.py by manifest.py and openerp by odoo

@yelizariev please check it


Enhancement: Improve Dockerfile for cached layer handling

What features would you like to see added?
Docker takes too long, couple simple manipulations will drastically improve build times and utilize cached layers, to avoid entire image rebuild on each run. You can see screenshots below, to notice build time differences
More details
something like this would result in a quicker build, given that you use runner that has docker cache, or pull :latest and use as cache. And minimize number of RUN commands, so that it doesn't persist layer after each command
here're the differences:

[*] first complete steps that are more permanent and don't need to be redone every time (like apk and npm -g)
[*] switch to user before copying files, this will automatically move files under that user
[*] WORKDIR will actually auto-create a folder with the set user already
[*] unfortunately requires tiny hardcode with paths, so we copy only changed code that requires re-compile before npm install
[*] then run NPM install (otherwise, it runs npm install and download tens of mbs on every codebase change)
copy all changed code
compile app

all steps that i marked, will re-use cached layers, and only app build will re-run on every rebuild of the app
this way, image build will go to seconds, if you use runners that have perstitent docker or use --pull in docker build command, to re-use cached layers (that will add few extra seconds to pull last built image as cache from docker registry)
Below is a working version of Dockerfile that I use it myself
# Base node image
FROM node:18-alpine AS node

RUN apk add --no-cache g++ make py3-pip curl && \
        npm config set fetch-retry-maxtimeout 300000 && \
        npm install -g node-gyp npm

USER node

WORKDIR /app

# Copy package.json and package-lock.json (if available)
COPY --chown=node:node package.json package-lock.json* ./
COPY --chown=node:node config config/
COPY --chown=node:node api/package.json api/
COPY --chown=node:node client/package.json client/
COPY --chown=node:node packages/data-provider/package.json packages/data-provider/

# Install dependencies
RUN npm install --no-audit
# Allow mounting of these files, which have no default
# values.
RUN touch .env

# Copy the rest of the application code
COPY --chown=node:node . .

# React client build
ENV NODE_OPTIONS="--max-old-space-size=2048"
RUN npm run frontend

# Node API setup
EXPOSE 3080
ENV HOST=<IP_ADDRESS>
CMD ["npm", "run", "backend"]

# Optional: for client with nginx routing
# FROM nginx:stable-alpine AS nginx-client
# WORKDIR /usr/share/nginx/html
# COPY --from=node /app/client/dist /usr/share/nginx/html
# COPY client/nginx.conf /etc/nginx/conf.d/default.conf
# EXPOSE 80
# ENTRYPOINT ["nginx", "-g", "daemon off;"]

Which components are impacted by your request?
No response
Pictures
Initial Build - before caching or if package-json files not changed

Consequent rebuild without code changes

Code changed in client only

Code of Conduct

[X] I agree to follow this project's Code of Conduct

Feel free to submit a PR. I made a Dockerfile change today, by the way, in case that affected your build time.

Just saw this, I think my PR #2275 aims to address this issue to some extent.

Just saw this, I think my PR #2275 aims to address this issue to some extent.

yes your PR addresses it for Dockerfile.multi but could use help optimize the default Dockerfile


#4185 Model 'change' event is not triggered after Exception.

PR for #4185

Good point! I'm now strongly leaning towards slapping a "wontfix" on this, but I'll leave it open for a day or so in case somebody else wants to reply.

I agree. Exceptions in the handler should ideally be handled and prevented by the dev, and consistent handler behavior is more useful overall than trying to take into account the edge cases this would have + applying them to the other handler functions in the library.


Home Assistant Weather Tile shows off by one day

I have read the comments in the forum after installing this add-on yesterday and I see this was an issue originally (~2020) but I had difficulty really understanding if the fix was on my end or the add on. I ensured my computer and home assistant had the right zone (-7 UTC, Pacific US). However, my weather tile still shows a day behind on the multi-day forecast. I apologize if I missed anything but hopefully the fix is rather easy. Thanks!
edit: Using 1.0.8 if that is needed, installed 4/7/22. I see another issue from 1.0.4 here so I assume this is not fixed?

You may want to load version 1.0.5 until the newer versions are fixed.

Just to make sure where the error is:
As I understand it, it is the weather.weatherbit entity that shows the wrong date? Is that correct?
What about the sensor.weatherbit_forecast_day_1, is that showing the correct date?

This is basically a duplicate of #62.

Correct....same as issue 62.

Both the weather.weatherbit  and sensor.weatherbit_forecast_day_1 entities have the correct date, but the time stamp is different  after ver. 1.0.5 as described below.  This is causing the displayed forecast to be off by one day. Today it is Saturday, but on versions after 1.0.5 it displays as Friday on dashboard, but the forecast numbers are for Saturday.
I'm thinking the problem is connected to the change made in version 1.0.6 described as "Fixing forecast date not in right format. Date needs to be a UTC time string and not DateTime object."
Time Stamp Difference between versions after 1.0.5:
"All version after 1.05 the forecast is one day behind, at least for my time zone.
On version 1.05 the entities created for sensor.weatherbit_forecast_day_1 is datetime: '2022-02-23T16:00:00+00:00', but all version after 1.05 the entity is created with a datetime: '2022-02-23T00:00:00+00:00'. I'm in the New York time zone, so the 00 hours minus 5 hours for the time zone correction makes the day 1 forecast header being marked as yesterday."

I have now made a pre-release of 1.0.9-beta.1 which contains a potential fix. I need you to test it out. If you run through HACS, you need Beta releases enabled to see it. I am also closing this issue now, so please continue with your feedback in Issue #62.


Set 1000 only if 100 < disk size < 1000 when querying IOPS

For quickly addressing the issue like -> http://stackoverflow.com/questions/36395860/no-data-for-iops-while-selecting-storage-size-250gb-or-500gb-in-performance-stor

@maximilien I added UTs, please help review again, thanks.

@mattcui this is completely wrong. Let's find some time (maybe 2 hours) on Sunday night or Monday to pair on this. I think you are completely missing the point.
Do you have a screenhero account? If not then let me know and I'll send you an invite.

@maximilien I rewrote this part of UT by leveraging counterfeiter UT framework. Please help review. If you agree with this approach, I will open another bug or chore to fix the wrong UT code in fake_softlayer_product_package.go. Please let me know if it's not what you want yet, we could book a time to pair on this. Thanks.


Bump SparkleFormation Version

This bumps sparkle_formation to latest.
Fixes #168

Can this please be merged in?

Hey, we need this as well, can we get this merged?

This would be super handy. Anyone have a fork with this merged?


DNN-8486: User Profile Image in View Profile Module doesn't use Image…

…Handler to render images

replacing template with ImageHandler based URL to bypass internal logic

looks good, merged


DNSTAP logging in Unbound-1.11.0

Hello, Wouter!
As i said earlier i have made patches set for Unbound-1.11.0 to log over DNSTAP both addresses - source (from client) address and destination (local or service) one. My core idea is to introduce NSD-like structure called unbound_socket and use it in comm_points of netevent code. So please look in my patches, i hope they will be reasonable and secure for application.
And only one TODO that i have to do in future - right now i can log only the front side, i.e. client requests and responses. Upstream side is currently logged as <IP_ADDRESS> local address. Its a question of some rework of outside_network code.
All the patches are in attached tarball.
Thank you in advance!
patches.tar.gz

You have to use freeaddrinfo for the free of list->socket->addr at listen_dnsport.c 1544.
I would prefer a couple of mallocs of the socket struct to be calloc, so that it is zeroed.
The malloc and free in the daemon worker handle routine to make the dst addr is cumbersome and it appear not really needed, it could put a struct sockaddr_storage on the stack there and pass that to the routine that fills the structure (now mk_local_addr that mallocs).  That would be faster and a lot of dnstap users value their speed.
Other than those initial review comments, it looks okay!  I can make those changes, or you can if you feel like it, and then it needs a bit more time from me to get a more detailed review.  Thanks for the re-submit of this with the bugs fixed that you found.

Ohh, yes!
And i agree with you about malloc(), - it was my blind paranoia to fetch new memory regions for every step in program :)) So it is a question of good program optimizing. Thank you for the valuable clarifications! Could you please to make the changes that you found by yourself? And then when you are done with detailed research i would like to download the final code to find out all the my mistakes ;) Also it would be great to get binary package with patched code of Unbound-1.11.0

I have created a branch and pull request at #367 .  There I imported the patches you linked in the tar.gz file, and then made the changes and some merge fixes and bug fixes.  You can review the code there.
A tarball with the code repository of today with the state of that code now is here https://nlnetlabs.nl/~wouter/unbound-1.13.1_20201209.tar.gz
The diff for the updated patches can be downloaded in this link https://patch-diff.githubusercontent.com/raw/NLnetLabs/unbound/pull/367.diff

Great work, Wouter!
And i looked into my patches for your changes and understood that mk_local_addr() was just like a ballast in the code :)) I completely forgot that we can pass repinfo->c->socket->addr directly to dt_msg_send_client_* functions. And also there are more accurate callocs/free in listen_dnsport.c source code. Looks great! Thank you very much!
So now i can download fresh tarball of Unbound!
Also i have made the same patches for NSD-4.2.2. There is more simplier code. And later i will send you the patchset to ask you to review the code for its correctness and optimality.

Applied your contributed code with review from my colleague @gthess from the linked pull request.  Thanks for the contribution!


Fix nginx config error parsing configmap

The error manifests as:
W0705 16:07:35.694677       7 configmap.go:431] unexpected error merging defaults: 2 error(s) decoding:

cannot parse 'proxy-connect-timeout' as int: strconv.ParseInt: parsing "10s": invalid syntax
cannot parse 'proxy-read-timeout' as int: strconv.ParseInt: parsing "10s": invalid syntax

I came across this trying to understand why my nginx ingress addon config isn't working, (this didn't help, but at least the warning is gone now.)
I'll continue to try to debug, but I think this can merge any time

it looks like a second issue is that kubevirt-launcher pods (node virtual machines) are not labeled with the expected ingress-nginx role label, so when the kubernetes-*-ingress-nginx frontend ingress service tries to route packets to the backend virtual machine nodes (who run nginx as daemonset) there is a service with no endpoints, and the traffic does not pass.
I went ahead and labeled one of those pods because I was sure it should have the label, and it was added to endpoints, but then a second problem:
my backend was configured for serving TLS, but it looks like the frontend didn't understand:

400 Bad Request
The plain HTTP request was sent to HTTPS port

So everything looked to me like nginx was configured for passthrough tls, but it's making HTTP requests to 443. Changing the ingress to have a backend port 80 setting worked (I was able to get traffic through to the podinfo service running on the virtualized cluster nodes) but that's obviously not the intended configuration, I will keep looking to see what went wrong with passthrough TLS and add to this PR when I figure it out.
It looks like there's more than one issue, (perhaps I'd better file them as separate issues so people following can see what happened when it's over)


dependencies error while installing in Nova 4

im getting the following error
`
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires outl1ne/nova-input-filter ^1.1 -> satisfiable by outl1ne/nova-input-filter[1.1.0].
- outl1ne/nova-input-filter 1.1.0 requires laravel/nova ^3.0 -> found laravel/nova[dev-master, v3.0.0, ..., 3.x-dev (alias of dev-master)] but it conflicts with your root composer.json require (~4.0).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
`
does the package support nova 4?

Nova 4 support added in version 2.0. :)


Custom headers are only showing first letter in the angular gantt table

I am using angular gantt-table. I want to add 2 more columns to the table header. But they are just showing up first letter in the header, and also table doesn't show any value of it. Can anyone help me to figure out what is wrong?
My JS:
app = angular.module("app")

app.controller "WorkitemsGanttController", ["$scope", "$q", "Project", "Workitem", ($scope, $q, Project, Workitem) ->
  $scope.init = ->
    $scope.projectId           = gon.projectId
    $scope.projectSequentialId = gon.projectSequentialId
    $scope.data                = []
    $scope.loadingData         = true
    $scope.options =
      columns: [
        'model.name'
        'wid'
        'wid_desc'
      ]
      columnsHeaders:
        'model.name': 'Name'
        'wid': 'WID'
        'wid_desc': 'WI Description'

    $q.all([
      Workitem.query({project_id: $scope.projectId}),
      Project.get($scope.projectId)
    ]).then((results) ->
      workitems =
        _.chain(results[0])
         .filter((workitem) ->
           workitem.showInGantt == true && moment(workitem.plannedFrom).isValid() && moment(workitem.plannedTo).isValid()
         ).sortBy('plannedFrom')
         .value()
      $scope.project     = results[1]
      $scope.data        = generateGanttData(workitems)
      $scope.loadingData = false
      return
    ).catch console.error.bind(console)

  generateGanttData = (workitems) ->
    _.map workitems, (workitem) ->
      {
        name: workitem.description
        tasks: [
          {
            from:     moment(workitem.plannedFrom).startOf('day')
            to:       moment(workitem.plannedTo).startOf('day')
            name: "#{moment(workitem.plannedTo).diff(moment(workitem.plannedFrom), 'days')} Days",
            color:   '#b6b6b6',
            wid: workitem.id,
            wid_desc: workitem.description
            progress:
              percent: workitem.progressInPercent || 0
              color:   '#000000'
          }
        ]
      }

  $scope.init()
]

And the html is:

Projects

Project #{{ projectSequentialId }}

Gantt

         Please wait, all data is loading...

      No suitable workitems yet. In order to display workitems in this diagram you need to check the 'Show in Gantt' checkbox of the workitem and set their planned 'from' and 'to' dates.

        <gantt-table columns="options.columns" headers="options.columnsHeaders"></gantt-table>
        <gantt-progress></gantt-progress>

And here is what I see in browser:

My angular version is 1.5.

Hi,
I faced a similar issue recently. Here is how you can do it:

tableHeaders and tableClasses define the extra column you're after
in css, you pick the class defined and assign it a minimum width
data variable provide the content for the extra column

here are code snippets:
controller.js:
$scope.options = {
  tableColumns: ['model.name', 'extra-column'],
  tableHeaders: {
    'model.name': 'Activity',
    'extra-column': 'Extra Column',
  },
  tableClasses: {
    'model.name': 'gantt-activity-name',
    'owner': 'extra-column',
  }
};

css:
.extra-column {
  min-width: 90px;
}

data
'data': [{
  "name": "task1",
  "columnContents": {
    "extra-column": "extra column content"
  }, ...

hope this works for you.
If it does, please confirm the answer.
Thanks.

Good afternoon, I have a similar problem, the CSS solved the issue with the custom column width, but unfortunatelly the custom column content doesn't show up yet, could you please point me out what is missing in the code bellow? (attached image)

After searching for two days, finally, I discovered it was a simple question of how I referenced the property as we have an object named row.model with a property named tasks that is an array and this array also contains an object. This object has a property named meucampo (or any other custom field name). So, to access this custom field (that is a property) we need to write as the following:  columnsContents: {'field1' : '{{row.model.tasks[0].field1}}'}
There is a very nice explanation in this link:
(https://stackoverflow.com/questions/11922383/access-process-nested-objects-arrays-or-json)


Build X86 and ARM versions of the images

Modify the build workflows to build linux/amd64 (x86) and linux/arm64 versions of the slic and wordpress images.
When running slic upgrade on machines using latest versions of Docker on ARM machine (e.g. MacOS on Apple Silicon or Asahi Linux on Apple Silicon), the operation would fail lamentin lack of an ARM version for the images:

before
after

This update to the workflows will build both versions making it possible to run slic on all machines.

Note: the first build of the images for both platforms took 4 ice ages; this notwithstanding the fact that, by default, the linux/amd64 version is built and should be cached already.
Builds are much faster now and will properly use the cache.


HBASE-25653 Add units and round off region size to 2 digits after decimal

:confetti_ball: +1 overall

Vote
Subsystem
Runtime
Comment

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

_ Prechecks _

+1 :green_heart:
dupname
0m  0s
No case conflicting files found.

+1 :green_heart:
hbaseanti
0m  0s
Patch does not have any anti-patterns.

+1 :green_heart:
@author
0m  0s
The patch does not contain any @author tags.

_ master Compile Tests _

+1 :green_heart:
mvninstall
4m 13s
master passed

+1 :green_heart:
compile
3m 16s
master passed

+1 :green_heart:
checkstyle
1m 11s
master passed

+1 :green_heart:
spotbugs
2m 14s
master passed

_ Patch Compile Tests _

+1 :green_heart:
mvninstall
3m 53s
the patch passed

-1 :x:
compile
1m 29s
hbase-server in the patch failed.

-0 :warning:
javac
1m 29s
hbase-server in the patch failed.

-0 :warning:
checkstyle
1m  9s
hbase-server: The patch generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)

+1 :green_heart:
whitespace
0m  0s
The patch has no whitespace issues.

+1 :green_heart:
hadoopcheck
21m  0s
Patch does not cause any errors with Hadoop 3.1.2 3.2.1 3.3.0.

+1 :green_heart:
spotbugs
3m 52s
the patch passed

_ Other Tests _

+1 :green_heart:
asflicense
0m 23s
The patch does not generate ASF License warnings.

54m  4s

Subsystem
Report/Notes

Docker
ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3046/2/artifact/yetus-general-check/output/Dockerfile

GITHUB PR
https://github.com/apache/hbase/pull/3046

Optional Tests
dupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile

uname
Linux 1e749500b093 4.15.0-136-generic #140-Ubuntu SMP Thu Jan 28 05:20:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Build tool
maven

Personality
dev-support/hbase-personality.sh

git revision
master / 876fec1648

Default Java
AdoptOpenJDK-1.8.0_282-b08

compile
https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3046/2/artifact/yetus-general-check/output/patch-compile-hbase-server.txt

javac
https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3046/2/artifact/yetus-general-check/output/patch-compile-hbase-server.txt

checkstyle
https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3046/2/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt

Max. process+thread count
86 (vs. ulimit of 30000)

modules
C: hbase-server U: hbase-server

Console output
https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3046/2/console

versions
git=2.17.1 maven=3.6.3 spotbugs=4.2.2

Powered by
Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@ndimiduk  @virajjasani please review.

@DivyeshChandra compilation failure msg: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3046/2/artifact/yetus-general-check/output/patch-compile-hbase-server.txt

:confetti_ball: +1 overall

Vote
Subsystem
Runtime
Comment

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

Tested with hbase in standalone mode.
2021-03-16 16:54:33,344 DEBUG [normalizer-worker-0] normalizer.SimpleRegionNormalizer: Table test configured with target region count -1, target region size -1 MB
2021-03-16 16:54:33,345 DEBUG [normalizer-worker-0] normalizer.SimpleRegionNormalizer: Table test, total aggregated regions size: 13 MB and average region size 1.625 MB
2021-03-16 16:54:33,345 DEBUG [normalizer-worker-0] normalizer.SimpleRegionNormalizer: Computing normalization plan for table:  test, number of regions: 8
2021-03-16 16:54:33,345 DEBUG [normalizer-worker-0] normalizer.SimpleRegionNormalizer: Table test, average region size: 1.625 MB
2021-03-16 16:54:33,346 INFO  [normalizer-worker-0] normalizer.SimpleRegionNormalizer: Table test, large region test,row34772,1615891773642.35fe6f0168e1aeba6bc309f100fe645b. has size 6 MB, more than twice avg size 1.625 MB, splitting


[help wanted] Understand how graph break work

All stuff in depfy works fine.
version: python==3.9.0, depyf==0.15.0
Here's the code I use, based on the readme.
import torch
from torch import _dynamo as torchdynamo
from typing import List
import numpy as np
from fn1 import fn1

@torch.compile(backend="eager", dynamic=True)
def toy_example(a, b):
    y = np.zeros((10, ))
    x = a / (torch.abs(a) + 1)
    res = fn1(x, y)
    if b.sum() < 0:  # graph break
        b = b * -1
        b = torch.pow(b, 2)
    else:            # graph break
        b = b * 2
        b = torch.pow(b, 2)
    return x * b, y, res

def main():
    for _ in range(100):
        toy_example(torch.randn(10), torch.randn(10))

if __name__ == "__main__":
    # main()
    # surround the code you want to run inside `with depyf.prepare_debug`
    import depyf
    with depyf.prepare_debug("./dump_src_dir"):
        main()

    # surround the code you want to debug inside `with depyf.debug()`
    with depyf.debug():
        print("hello world")
        main()

Question: According to the generated file dump_src_dir/full_code_for_toy_example_0.py, why transformed___resume_at_50_2() is not called by __transformed_code_0_for_toy_example()? In other words, why the subgraph generated by torch.compile() is not called after graph break?
# Note: if there is a transformed version below, this function might well not be executed directly. Please check the transformed version if possible.
def __resume_at_50_2(b, y, x, res):
    b = b * -1
    b = torch.pow(b, 2)
    return x * b, y, res

def transformed___resume_at_50_2(b, y, x, res):
    L = {"b": b, "y": y, "x": x, "res": res}
    if __guard_0_for_torch_dynamo_resume_in_toy_example_at_16(L):
        return __transformed_code_0_for_torch_dynamo_resume_in_toy_example_at_16(b, y, x, res)
    # Note: this function might well not be executed directly. It might well be transformed again, i.e. adding one more guards and transformed code.
    return __resume_at_50_2(b, y, x, res)

def __transformed_code_0_for_toy_example(a, b):
    graph_out_0 = __compiled_fn_1(a, b)
    res = graph_out_0[3]
    x = graph_out_0[2]
    y = __import_torch_dot__dynamo_dot_utils.to_numpy_helper(graph_out_0[1])
    if graph_out_0[0]:
        return __resume_at_50_2(b, y, x, res)
    return __resume_at_72_3(b, y, x, res)

def transformed_toy_example(a, b):
    L = {"a": a, "b": b}
    if __guard_0_for_toy_example(L):
        return __transformed_code_0_for_toy_example(a, b)
    # Note: this function might well not be executed directly. It might well be transformed again, i.e. adding one more guards and transformed code.
    return toy_example(a, b)

return __resume_at_50_2(b, y, x, res) this line does not mean directly calling __resume_at_50_2 function. It means calling the function with dynamo enabled, which will check the compiled code and guards. This procedure happens in C code, and depyf illustrates the process for you.
You can note the comment before  __resume_at_50_2:

# Note: if there is a transformed version below, this function might well not be executed directly. Please check the transformed version if possible.

This means, when you see return __resume_at_50_2(b, y, x, res) in __transformed_code_0_for_toy_example, you should follow transformed___resume_at_50_2, which, after checking guards, should call __transformed_code_0_for_torch_dynamo_resume_in_toy_example_at_16 .

Further question, when will __guard_1_for_torch_dynamo_resume_in_toy_example_at_16() become true?
In my situation, the code don't step into __transformed_code_0_for_torch_dynamo_resume_in_toy_example_at_16(), it just returns back to origin scipt example.py, instead of the subgraph compiled fn, i.e. __compiled_fn_5 Captured Graph 0.py

The guard information should be added back in https://github.com/thuml/depyf/pull/30 . Please try the latest code.
PyTorch recently uses cpp guards by default, so you cannot see the python code. I switch it back to Python guards so that we can view it.


[question,documentation]How to load API keys list from json file?

I would like to know how to properly tell local-ai, that I want it to read api keys from api_keys.json
I have tried following command
docker run -p 8080:8080 --gpus all --name local-ai -e DEBUG=true -v $PWD/models:/models -v $PWD/tmp/generated/images:/tmp/generated/images -d  localai/localai:latest-aio-gpu-nvidia-cuda-12 --models-path /models --context-size 1024 --threads 8 --api-keys api_keys.json

Then I tried to get completion using langchain as usual and got 401 error
logs of local-ai simply says
@@@@@
1:00PM INF Starting LocalAI using 8 threads, with models path: /models
1:00PM INF LocalAI version: v2.11.0 (1395e505cd8f1cc90ce575602c7eb21706da6067)
1:00PM DBG [startup] resolved local model: /aio/gpu-8g/embeddings.yaml
1:00PM DBG [startup] resolved local model: /aio/gpu-8g/text-to-speech.yaml
1:00PM DBG [startup] resolved local model: /aio/gpu-8g/image-gen.yaml
1:00PM DBG [startup] resolved local model: /aio/gpu-8g/text-to-text.yaml
1:00PM DBG [startup] resolved local model: /aio/gpu-8g/speech-to-text.yaml
1:00PM DBG [startup] resolved local model: /aio/gpu-8g/vision.yaml
1:00PM INF Preloading models from /models
1:00PM DBG Checking "ggml-whisper-base.bin" exists and matches SHA
1:00PM DBG File "/models/ggml-whisper-base.bin" already exists and matches the SHA. Skipping download

...........

[<IP_ADDRESS>]:58146 401 - POST /chat/completions

I have read https://localai.io/advanced/
and also I have looked into https://github.com/mudler/LocalAI/blob/89f9274bfe5080d9c22273b3fa91e238c19a7e27/api/api.go#L154
But I don't get error about parsing json file, neither error of invalid api key, neither authorization header error
Documentation only says about how to load keys from .env , but not for json file, so I am not quite understand how to set this flag correctly
I am aware, that (according to docs) I can just pass list of keys as arguments for flag, but I would like to know how to feed it json file, so I would not reboot whole thing everytime I add new key
Should I somehow to add this file into some directory and somehow attach it to local-ai docker directory? How should I do it?

Right answer is to mount directory with api_keys.json  like this:
docker run ...  -v $PWD/config:configuration and put your file there


Use break-word instead of break-all in about modal

We're using word-break: break-all; here, which will break a word unnecessarily. Let's use break-word instead.

:tada: This issue has been resolved in version 2.17.3 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Add security related info to helm installs

Please provide a description of this PR:
Add links to supported releases, CVE bulletins and the hardening guide for helm based installs/upgrades.

It's fine if we decide to not include this.


VLAZ: Watch oxycodontiawan.com

VLAZ requests the watch of the watch_keyword oxycodontiawan\.com. See the MS search here and the Stack Exchange search in text, in URLs, and in code.

oxycodontiawan\.com has been seen in 1 true positive, 0 false positives, and 0 NAAs.

Rejected by Mast in Charcoal HQ. Reason: 'Duplicate of 8077'


Jailbreak Unc0ver till 13.3

Why did you not mention the Unc0ver jailbreak for A12/A13 devices till iOS 13.3?

Now unc0ver for A12/A13 till iOS 13.5 is out.

Thanks for opening this issue. I've updated canijailbreak to recognise all 13.5 jailbreaks.


Bratseth/job run reason tweaks

@mpolden please review

Can we keep the build number? It was added to enable mapping SD jobs to events when debugging.

We have the build jobs in the API and dashboard now (as direct links to the jobs). Will that do?
I'm trying to make these short enough to fit on one line ...

My experience with deploying deployment orchestration proved that any sort of extensive debugging is very hard (if not impossible) without the build number. This may no longer be the case though.

I'm trying to make these short enough to fit on one line

I understood that, but this seems like a futile way of controlling word wrapping. Your call :-)

s/futile/pragmatic/  :-P
I'll merge, with the assumption that we can get what we need from the dashboard next time. If that is wrong you'll be able to blame me  :-)


Remove line breaks to fix paragraph rendering on website

The introduction paragraphs at http://go.sap.com/developer/tutorials/ci-best-practices-intro.html look very ugly. This correction should fix that.

Original contributors: @marionschlotte and @wolframK


Move some dependency to devDependency

close #135

You are welcome 😄

You are very productive! ;)

I'm doing my best 😅
Using the plugins in a real project allow to identify issues faster and I need to fix them fast too :)
I'm going to work on #145 now


issues #169 and #201 : Added support to configure BigQuery partition

…ition type

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Darshan Mehta seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

Codecov Report

Merging #202 into master will increase coverage by 0.14%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master     #202      +/-   ##
============================================
+ Coverage     70.24%   70.39%   +0.14%
- Complexity      275      276       +1
============================================
  Files            34       34
  Lines          1452     1459       +7
  Branches        143      144       +1
============================================
+ Hits           1020     1027       +7
  Misses          388      388
  Partials         44       44

Impacted Files
Coverage Δ
Complexity Δ

...onnect/bigquery/config/BigQuerySinkTaskConfig.java
93.61% <100%> (+0.59%)
4 <0> (ø)
:arrow_down:

...wepay/kafka/connect/bigquery/BigQuerySinkTask.java
60.46% <100%> (+0.7%)
25 <0> (+1)
:arrow_up:


No Source for Code

Describe the bug
I'm attempting to follow your recent blog post on Making a coverage badge and always run into the same error:
No source for code: '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py'.

I tried deleting *.pyc files after reading this SO post, but it didn't solve my problem. I also searched several issue reports here having the same problem, but couldn't find an answer. I tried ignoring the error with -i, which also didn't seem to help.
Here is a link to the Actions tab of my GitHub repo. It has almost no code (just some # pragma: no cover statements in the qtpygraph/__init__.py file). I tried using COVERAGE_DEBUG=trace but I can't seem to get it to print to GitHub Action's stdout.
To Reproduce
How can we reproduce the problem?  Please be specific. Don't link to a failing CI job. Answer the questions below:

What version of Python are you using?

3.8, 3.9, 3.10 on Windows, MacOs, and Ubuntu. Coverage is combined using ubuntu-latest with Python 3.10 on GitHub Actions.

What version of coverage.py shows the problem? The output of coverage debug sys is helpful.

6.5.0

What versions of what packages do you have installed?   Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.

Please see qtpygraph commit dc2807

What commands did you run?

tox configuration in pyproject.toml
[tool.tox]
legacy_tox_ini = """
[tox]
minversion = 3.25.0
envlist = py{38,39,310}-{pyqt5,pyside2,pyqt6,pyside6}
isolated_build = true

[gh-actions]
python =
    3.8: py38-{pyqt5,pyside2,pyqt6,pyside6}
    3.9: py39-{pyqt5,pyside2,pyqt6,pyside6}
    3.10: py310-{pyqt5,pyside2,pyqt6,pyside6}

[testenv]
allowlist_externals =
    poetry
    pytest
setenv =
    pyqt5: PYTEST_QT_API=pyqt5
    pyqt5: QT_API=pyqt5
    pyside2: PYTEST_QT_API=pyside2
    pyside2: QT_API=pyside2
    pyqt6: PYTEST_QT_API=pyqt6
    pyqt6: QT_API=pyqt6
    pyside6: PYTEST_QT_API=pyside6
    pyside6: QT_API=pyside6
    QT_QPA_PLATFORM=offscreen
    # See: https://github.com/tox-dev/tox/issues/1550
    PYTHONIOENCODING=utf-8
    COVERAGE_FILE=tox-.coverage.{envname}
commands =
    poetry install --no-root
    pyqt5: poetry run python -m pip install PyQt5 PyQt5-stubs
    pyside2: poetry run python -m pip install PySide2 PySide2-stubs
    pyqt6: poetry run python -m pip install PyQt6 IceSpringPySideStubs-PyQt6
    pyside6: poetry run python -m pip install PySide6 IceSpringPySideStubs-PySide6
    poetry run pytest

# Not run by default. To run, use `tox -e coverage`
[testenv:coverage]
allowlist_externals =
    find
deps =
    coverage
    tox
basepython = python3.10
setenv =
    COVERAGE_FILE=tox-.coverage
    COVERAGE_DEBUG=trace
    COVERAGE_DEBUG_FILE=stdout
commands =
    find . -name "*.pyc" -delete
    coverage combine
    coverage report -m --skip-covered --debug=trace
    coverage html
    coverage json
    sh -c 'mv -f tox-.coverage .coverage'
    sh -c 'rm -f tox-.coverage'
parallel_show_output = true

# Not run by default. To run, use `tox -e docs`
[testenv:docs]
allowlist_externals =
    poetry
    sphinx-build
commands =
    poetry install --no-root
    poetry run sphinx-build -W --keep-going -b docs docs/build
"""

Expected behavior
A clear and concise description of what you expected to happen.
Coverage is able to combine data from separate runs and produce a badge, as in the scriv repo and demonstrated in the Making a coverage badge blog post.
Additional context
Add any other context about the problem here.
N/A (If you need more details, please let me know.)

Can you add some debugging? Before your coverage combine command, add coverage debug data, and change the combine step to coverage combine --debug=pathmap.  That will give us some good data.

@nedbat Yes, I'll do that right now. Give me a couple minutes to report back.

The link to the latest run is here, but the relevant output is as follows:

commands[0] | coverage debug data
-- data ------------------------------------------------------
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage
No data collected: file doesn't exist
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py38-pyqt6
has_arcs: False
1 file:
/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py39-pyqt6
has_arcs: False
1 file:
D:\a\qtpygraph\qtpygraph\qtpygraph\__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py310-pyside6
has_arcs: False
1 file:
D:\a\qtpygraph\qtpygraph\qtpygraph\__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py39-pyqt5
has_arcs: False
1 file:
D:\a\qtpygraph\qtpygraph\qtpygraph\__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py310-pyside2
has_arcs: False
1 file:
D:\a\qtpygraph\qtpygraph\qtpygraph\__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py39-pyside2
has_arcs: False
1 file:
D:\a\qtpygraph\qtpygraph\qtpygraph\__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py38-pyqt5
has_arcs: False
1 file:
/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py38-pyside2
has_arcs: False
1 file:
/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py310-pyqt6
has_arcs: False
1 file:
D:\a\qtpygraph\qtpygraph\qtpygraph\__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py310-pyqt5
has_arcs: False
1 file:
D:\a\qtpygraph\qtpygraph\qtpygraph\__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py38-pyside6
has_arcs: False
1 file:
/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py: 0 lines
-----
path: /home/runner/work/qtpygraph/qtpygraph/tox-.coverage.py39-pyside6
has_arcs: False
1 file:
D:\a\qtpygraph\qtpygraph\qtpygraph\__init__.py: 0 lines

commands[1] | coverage combine --debug=pathmap
Aliases (relative=False):
 Rule: '.tox/py*/Lib/site-packages/' -> 'qtpygraph/' using regex '(?:(?s:[\\\\/]home[\\\\/]runner[\\\\/]work[\\\\/]qtpygraph[\\\\/]qtpygraph[\\\\/]\\.tox[\\\\/]py.*[\\\\/]Lib[\\\\/]site\\-packages[\\\\/]))'
 Rule: '.tox/linting/Lib/site-packages/' -> 'qtpygraph/' using regex '(?:(?s:[\\\\/]home[\\\\/]runner[\\\\/]work[\\\\/]qtpygraph[\\\\/]qtpygraph[\\\\/]\\.tox[\\\\/]linting[\\\\/]Lib[\\\\/]site\\-packages[\\\\/]))'
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py38-pyqt6
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py39-pyqt6
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py310-pyside6
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py39-pyqt5
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py310-pyside2
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py39-pyside2
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py38-pyqt5
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py38-pyside2
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py310-pyqt6
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py310-pyqt5
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py38-pyside6
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged
Combined data file tox-.coverage.py39-pyside6

commands[2] | coverage report -m --skip-covered
No source for code: '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py'.
ERROR: InvocationError for command /home/runner/work/qtpygraph/qtpygraph/.tox/coverage/bin/coverage report -m --skip-covered (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   coverage: commands failed
Error: Process completed with exit code 1.

The __init__.py seems to be picked up...

@nedbat The regex's seem to start with /home/, but the data paths start with /Users/. Does that have any bearing on this?

@nedbat Actually, if I'm reading the --debug=pathmap output correctly, it looks like my coverage.run.paths might not be set up correctly.
Here are the relevant portions of my pyproject.toml [tool.coverage.*] configuration entries:
[tool.coverage.run]
branch = true
# Append machine name, process id, and random number to data file name so coverage can be
# run in parallel environments, e.g. in tox.
parallel = true
# `shiboken6`, which creates the python bindings for `Qt` C++ source, imports from a
# `zip` file into the top-level directory at runtime. These files are deleted after
# running, but `coverage` attempts to look at their source after they're gone, causing
# warnings to appear. Namely, it looks for these modules/files:
#
#    project_dir/pysrcript
#    project_dir/shibokensupport
#    project_dir/signature_bootstrap.py
#
# To avoid this error, `source` is specified to the package subdirectory. However, this
# can also be avoided by explicitly omitting these folders in the `omit` section.
#
# See https://github.com/nedbat/coveragepy/issues/1392
source = [
    'qtpygraph/'
]
omit = [
    'qtpygraph/__main__.py',
    '.vscode/',
    '.venv/',
    'tests/',
    'stubs/'
]
disable_warnings = ['no-data-collected']

[tool.coverage.html]
directory = 'logs/coverage/html'

[tool.coverage.json]
output = 'logs/coverage/coverage.json'

[tool.coverage.xml]
output = 'logs/coverage/coverage.xml'

[tool.coverage.report]
exclude_lines = [
    'pragma: no cover',
    'def __repr__',
    'raise AssertionError',
    'raise NotImplementedError',
    'if __name__ == .__main__.:',
    '@(abc\.)?abstractmethod'
]

[tool.coverage.paths]
source = [
    "qtpygraph/",
    ".tox/py*/Lib/site-packages/",
    ".tox/linting/Lib/site-packages/"
]

@nedbat Indeed, switching my tool.coverage.paths fixed the problem:
[tool.coverage.paths]
source = [
    "qtpygraph/",
    "*/site-packages"
]
others = [
    "qtpygraph/",
    "*/qtpygraph",
]

but:

I don't understand why. I took a page from scriv's tox.ini. Can you explain a little more of what is going on here?

I've now run into another problem: the schneegans/dynamic-badges-action isn't letting me write to my gist:

Failed to create gist, response status code: 401, status message: Unauthorized

Below is the relevant section of my workflow file (test.yml):
- name: Make Coverage Badge
  uses<EMAIL_ADDRESS>  with:
    # `GIST_TOKEN` is simply a personal access token with a scope of "gist".
    auth: ${{ secrets.GIST_TOKEN }}
    gistID: 93a225b73dfa5ee041e6786dfbeff9ad
    filename: coverage_badge.json
    label: Coverage
    message: ${{ env.total }}%
    minColorRange: 50
    maxColorRange: 90
    valColorRAnge: ${{ env.total }}

and the link to my gist is here.
Should I open a separate issue for this?

@nedbat I opened issue #15 on dynamic-bages-action for my second problem, so if you can explain why changing my [tool.coverage.paths] fixed the problem, we can close this issue.

Starting disclaimer: I am not an authority on the subject, just another dev working through a very similar issue (now resolved thanks to this thread).
The key difference appears to be the isolated_build = true flag that the scriv project does not use. If I understand this explanation; the flag changes the source of the files being tested from the project directory to an isolated */site-packages/ install. It's also a required flag if the project uses pyproject.toml over setup.cfg and/or setup.py.
This is good, imo, but it also requires us to give coverage some extra information on how to transform the paths back to the project structure. That's my theory, at least, after three hours of poking around at my own template project to add the same groovy coverage badge.

just another dev working through a very similar issue (now resolved thanks to this thread).

Glad I could help!

The key difference appears to be the isolated_build = true flag that the scriv project does not use.

That's a good thought, but the scriv/setup.cfg settings for coverage:paths use the same pattern of reporting same-named files in */site-packages to those in the original source:
[coverage:paths]
source =
    src
    */site-packages

others =
    .
    */scriv

which is how I discovered that I should write my pyproject.toml configuration like so in the first place:
[tool.coverage.paths]
source = [
    "qtpygraph/",
    "*/site-packages"
]
others = [
    "qtpygraph/",
    "*/qtpygraph",
]

So if scriv doesn't use isolated_build = true, which you correctly pointed out, it seems the reason for setting paths like this is deeper than isolated_build = True, or unrelated.
@nedbat Why are the paths listed like this?

@nedbat Following up on this before it gets too far away from us. Can you please explain why paths are listed like this?

I see this line in your debug output:
No rules match, path '/Users/runner/work/qtpygraph/qtpygraph/qtpygraph/__init__.py' is unchanged

This was under your old rules:
[tool.coverage.paths]
source = [
    "qtpygraph/",
    ".tox/py*/Lib/site-packages/",
    ".tox/linting/Lib/site-packages/"
]

where indeed, there is no match, since the path has no .tox in it, not to mention the rest of the pattern.
You changed your rules to:
[tool.coverage.paths]
source = [
    "qtpygraph/",
    "*/site-packages"
]
others = [
    "qtpygraph/",
    "*/qtpygraph",
]

(which btw, could be simpler, since the first item, the map-to, is the same in both:)
[tool.coverage.paths]
source = [
    "qtpygraph/",
    "*/site-packages"
    "*/qtpygraph",
]

Now the path is matched by */qtpygraph, so it is remapped to be qtpygraph/qtpygraph/qtpygraph/__init__.py.

Thank you @nedbat! Thank you also for coverage.py, your wonderful PyCon talks, and all your contributions to the Python community! I hope all is going well.


/beacon/finalized_checkpoint

document finalized_checkpoint with openApi and check to see if its in the eth2 spec.

prysm has the same data structure in their v1Alpha1Checkpoint object, but not sure how that's used.
https://api.prylabs.net/#/
Couldn't find this in the lighthouse markdown

needs OpenApi documentation
needs unit tests


[HELP] Cannot able to connect with testnet

I tried running start.sh but nodeos doesnot started after that i tried start_wallet.sh it shows
./Wallet/start_wallet.sh: line 17: /home/eos/build/programs/keosd/keosd: No such file or directory
where i have available all the files at the same path.
Here i am also attaching my config file please correct me if is there any problems in config.ini
config.ini.zip

What start.sh script are you using?  The current repository has no such script.

Here is my start.sh script @jgiszczak
`NODEOSBINDIR="/home/eos/build/programs/nodeos"
DATADIR="/opt/JungleTestnet"
$DATADIR/stop.sh
echo -e "Starting Nodeos \n";
ulimit -n 65535
ulimit -s 64000
$NODEOSBINDIR/nodeos --data-dir $DATADIR --config-dir $DATADIR "$@" > $DATADIR/stdout.txt 2> $DATADIR/stderr.txt &  echo $! > $DATADIR/nodeos.pid`

That looks like a perfectly serviceable start script.  What does your start_wallet.sh script look like?

@jgiszczak  here i am attaching my all testnet scripts and genesis.json file.
Testnet Scripts.zip

here is i met with error when i tried run start_wallet.sh have a look at this also @jgiszczak

Your start_wallet.sh script contains $NODEOSBINDIR/keosd/keosd but your start.sh script contains NODEOSBINDIR/nodeos, but you said you "had all files available at the same path".  Remove the keosd subdirectory in start_wallet.sh and the keosd binary will be found.  $NODEOSBINDIR/keosd

@yashbhavsar007  Change data directory in start.sh like this DATADIR="/opt/JungleTestnet/EOS-Jungle-Testnet"  and same in ./Wallet/start_wallet.sh along with the actual path of keosd.

@Aniket-Engg  I have changed name of folder after cloning from EOS-Jungle-Testnet to JungleTestnet so i don't need to change path and thanks for response but this issue is resolved now.


Request: Left Close/Max/Min buttons variant for custom title bar

I really like the new title bar style that can be activated by "editor.titleBarStyle": "custom". However, as a long time Ubuntu user I'm accustomed to my window close/max/min controls being on the left hand side of the title bar. Is is possbible to have another member in the titleBarStyle enum "custom-left" or something named similarly to have the controls render on the far left rather than the far right in the order close, minimize, maximize(restore)?
Below, the native menu for VS Code (I do not mind the square buttons of the ciustom style as they fit well with the VS brand):

I am in the same position. The custom title bar looks great - I don't mind if it can't inherit the button style, but the positioning would be a nice start!

My reason for using this setting is because it's the suggested workaround for blank menus on ubuntu. Is there an open issue for that?

@spencergibb the electron issue is fixed but not yet in stable builds https://github.com/electron/electron/issues/15194

+1

Are PRs welcome for this feature request?
I know this issue is not labelled as "help-wanted" but there is little to no activity in a while.
Would be happy to contribute if needed :)

File > Preferences > Settings > Windows > Title Bar Style set to native
The above should work if you configured your minimize, maximize and close buttons' position to the left.

I really like a new custom style title bar style, but it would be better to have a option to put close/min/max buttons on the left. There are plenty of Ubuntu users...

File > Preferences > Settings > Windows > Title Bar Style set to native
The above should work if you configured your minimize, maximize and close buttons' position to the left.

works for me on KDENeon, when buttons are set on the left

Since this feature request came at a time when custom was the default for linux, I am closing it now. The preferred experience on linux is the native title bar to avoid implementing custom DE logic ourselves. If you like the custom titlebar, I am happy, but unfortunately, adding linux customization will not happen.

Since new features are being added to the custom title bar style, such as the Command Center and the layout control buttons, I wonder if this issue should be reconsidered, assuming that there's interest in it of course.
I'm probably missing some other piece of information but form a very quick search, Electron seems to have been tracking Linux CSD support in this issue: https://github.com/electron/electron/issues/11907, and here for wayland: https://github.com/electron/electron/issues/27522

The native title bar crashes on linux (#184124). Would be great to revisit this.

I would like to use this feature as electron apps ignore fonts scale factor on wayland session and native title bar looks small. And custom title bar doesn't allow title bar icons move (close, maximize etc.).

"Native" is unusable on linux with scaled desktop. Custom works, but the theme doesn't follow the window control placement.


x/tools/gopls: bug.Reportf("no metadata for %s") reached in hover.go

While snooping around in the file cache I noticed a crash dump from a non-test binary: the v0.12.0 release binary, in fact. The report is
{
   "AtTime" : "2023-06-01T16:57:35.701388-04:00",
   "Description" : "no metadata for file:///Users/adonovan/w/xtools/aaa/aaa.go",
   "File"<EMAIL_ADDRESS>   "Key" : "/Users/adonovan/go/pkg/mod/golang.org/x/tools/gopls@v0.12.0/internal/lsp/source/hover.go:272",
   "Line" : 272,
   ...
}

The stack (which I've omitted) provides no useful information that isn't deducible from the line number above. Here's the source:
		// For package names, we simply link to their imported package.
		if pkgName, ok := obj.(*types.PkgName); ok {
			linkName = pkgName.Name()
			linkPath = pkgName.Imported().Path()
			impID := linkMeta.DepsByPkgPath[PackagePath(pkgName.Imported().Path())]
			linkMeta = snapshot.Metadata(impID)
			if linkMeta == nil {
				return protocol.Range{}, nil, bug.Errorf("no metadata for %s", declPGF.URI) // <--- here
			}
		} else {

Sadly I no longer have (or remember) the contents of aaa.go, a scratch file I used for a quick experiment.
Also: although gopls stats decodes bug reports from the same executable, it's surprisingly laborious to enumerate and decode all the bug reports from all versions $GOPLSCACHE/gopls/*/*/*-bug, since these (binary) files contain the (hex) names of other files: a sort of binary symlink. (I ended up just grepping for the shibboleth "AtTime".) It would be nice if there was a simple command to print all bug reports in the GOPLSCACHE, including those from other gopls binaries (a best-effort decoding, of course, since the format may evolve).

I was able to reproduce this at master (87ad891) by hovering over the foo in foo.Print in this program:
package main

import foo "a"

func _() {
	foo.Print()
}


am trying to alert getZoom() method upon a click event but it seem not to work

https://github.com/Leaflet/Leaflet.markercluster/blob/master/CONTRIBUTING.md#reporting-bugs


Fix StackOverflowError initializing CommonRules

A user has reported a StackOverflowError initializing CommonRules.  This PR reduces stack consumption.

The default depth is reduced, so it works on smaller-stack environments.
The default depth is referenced from a canonical constant in the relevant header instances.

I consider this more defect than security, but it could be backported to 0.22 if anyone is so motivated.

Codecov Report

Merging #6920 (4c9e054) into series/0.23 (3e73b2f) will decrease coverage by 0.01%.
The diff coverage is 40.00%.

@@               Coverage Diff               @@
##           series/0.23    #6920      +/-   ##
===============================================
- Coverage        71.15%   71.13%   -0.02%
===============================================
  Files              340      340
  Lines            10371    10370       -1
  Branches           934      895      -39
===============================================
- Hits              7379     7377       -2
- Misses            2992     2993       +1

Impacted Files
Coverage Δ

...cala/org/http4s/internal/parsing/CommonRules.scala
96.96% <0.00%> (-0.09%)
:arrow_down:

...red/src/main/scala/org/http4s/headers/Server.scala
87.50% <50.00%> (ø)

...src/main/scala/org/http4s/headers/User-Agent.scala
78.94% <50.00%> (ø)

core/shared/src/main/scala/org/http4s/Method.scala
96.80% <0.00%> (-1.07%)
:arrow_down:

...n/scala/org/http4s/laws/discipline/arbitrary.scala
86.53% <0.00%> (-0.20%)
:arrow_down:

core/shared/src/main/scala/org/http4s/Uri.scala
89.11% <0.00%> (ø)

core/shared/src/main/scala/org/http4s/MimeDB.scala
97.64% <0.00%> (+1.17%)
:arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

Oops.  Thought I got away with the nowarn when I removed the deprecated object name. Thanks for the touchup.


move zeros to the end of array

Thanks, @profnandaa for the headstart.
I will do that.

@profnandaa pushed a better solution than the previous one.


Feature Request: Executing commands on servers over WinRM

Our team has grown interested in Terratest, however most of our infrastructure is Windows based.  We'd need a WinRM module to enable "Executing commands on servers over WinRM".  I'd envision this as a winrm module similar to the existing ssh module.

Agreed. If anyone has time to work on this, a PR is very welcome!


browse: fix arbitrary ordering of directories with sort=size

While reading browse I noticed this one. We've given directories a special treatment due to differences in filesystem implementations, but actually forgot to sort them further by the next dimension.
As their order has been undefined until now (their apparent size is set to -1 anyway), this does not change any expectations of legacy scripts.

Thank you @wmark! Appreciate the attention to detail.


Issue 9401 - SequentialChain runs the same callbacks over and over in async mode

Issue: https://github.com/langchain-ai/langchain/issues/9401
In the Async mode, SequentialChain implementation seems to run the same callbacks over and over since it is re-using the same callbacks object.
Langchain version: 0.0.264, master
The implementation of this aysnc route differs from the sync route and sync approach follows the right pattern of generating a new callbacks object instead of re-using the old one and thus avoiding the cascading run of callbacks at each step.
Async mode:
        _run_manager = run_manager or AsyncCallbackManagerForChainRun.get_noop_manager()
        callbacks = _run_manager.get_child()
        ...
        for i, chain in enumerate(self.chains):
            _input = await chain.arun(_input, callbacks=callbacks)
            ...

Regular mode:
        _run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
        for i, chain in enumerate(self.chains):
            _input = chain.run(_input, callbacks=_run_manager.get_child(f"step_{i+1}"))
            ...

Notice how we are reusing the callbacks object in the Async code which will have a cascading effect as we run through the chain. It runs the same callbacks over and over resulting in issues.
Solution:
Define the async function in the same pattern as the regular one and added tests.

Thanks @vamseeyarla !


instructions that make :vectors

:x-fromstack
:x-fromexample
:x-build

Added :x-fromexample and :vector-fromexample in 64627550abff6cf42b4853b9ff0dccc6ec66cba4

added :x-build in b9b6ac6d3d7974ac3dadbc21ccaacbea5ecf769d


Website

Single page website design. Menu on left. Sandwich icon on mobile.
Mention not available on Chrome OS. Mention continuation of Web Server for Chrome.

[x] Remember site meta tags

Home -> GitHub link, Screenshots and description
Download -> Download links, install instructions, changelog, link to build from source docs
Documentation
• Server Options
• App Settings
• Specific feature docs

[x] TODO: Favicon

@terreng Whats this for?

I'm going to build a website for our app. It'll have a description of what it does and screenshots, a download button, and it'll have all of our documentation.

@terreng Sounds Awesome!
I had an idea that for opening the readme's (the htaccess/post/ipblocking) to use the window.open method (From the window) and open an html with the readme, this way there will be no required internet access (In case github is blocked or internet is down)

I'm going to include an explanation for all the options that you'll be able to view by clicking a question mark icon next to each option. Some of the options require longer explanations, so they will link to one of the readmes. I'm actually going to include them using an iframe, but its very similar to what you described.
We should have documentation explaining what all of the options do, what their valid values are, and linking to longer explanations if necessary.

We now have https://simplewebserver.org

that is awesome!

@ethanaobrien The website is coming along. Take a look at the documentation section and let me know what you think. https://simplewebserver.org/

Wow I love the look. It's really clean. Keep doing what youre doing it looks good!

@ethanaobrien Please see Coming from Web Server for Chrome? and let me know if you have any thoughts.

Thanks for the suggestion. I didn't realize this was possible without any changes to the app. Could you link to a good article about how to do it?

I think this is a pretty good guide, walks you through pretty thoroughly.

Do you want to add IPV6 support in a pr that closes https://github.com/terreng/simple-web-server/issues/80? Let's call the boolean option ipv6. Update getIPs() to include both ipv4 and ipv6, and in the UI I'll add code to filter the list of ips based on the ipv6 option.

Yes, would you like me to have each url as an object with the properties isIpv4 (true or false) and address (the text) or do you just want me to push everything as a string and you have the detection?
Also make sure you follow the instructions here to format the ipv6 address properly

I actually already added a favicon yesterday. You might just need to refresh the page/clear cache.

I just looked at the source and realized the problem. I think icons need to be in the .ico file format. I see the tag but my browser does not load the icon

I think this is a pretty good guide, walks you through pretty thoroughly.

Thanks for linking that. I'll update the documentation accordingly.

Yes, would you like me to have each url as an object with the properties isIpv4 (true or false) and address (the text) or do you just want me to push everything as a string and you have the detection?

My first thought was to just filter based on the ips themselves, but I think your suggestion is a better idea. Let's have getIPs() return an array of address and type pairs, like so: [["1270.0.1","ipv4"],["1080::8:800:200c:417a","ipv6"]]
I will have to update the interval on line 230 of index.js and the UI code in order to support this change. It might break things for now once you make the change.
Thanks for the details about formatting ipv6, that's super helpful. I'll make sure to follow that.

I think icons need to be in the .ico file format. I see the tag but my browser does not load the icon

Yes, I've already added the favicon at /favicon.ico. I think favicons can be pretty aggressively cached. Just open DevTools, right click on the refresh option, and choose empty cache and hard reload.

I just opened a pr.

Yes, I've already added the favicon at /favicon.ico. I think favicons can be pretty aggressively cached. Just open DevTools, right click on the refresh option, and choose empty cache and hard reload.

Found it. You are setting the rel to shortcut icon. As this comment states this is only technically supported in ie. Not sure why it is loading for you as nothing seems to be working for me, even when I do the steps you provided

Not sure why it is loading for you as nothing seems to be working for me, even when I do the steps you provided

I can assure you that I have set up the favicon properly.

You saw the part of my comment where I said the method you are using to set the favicon is only supported on IE right?

Please believe me that I know what I'm doing. <link rel="shortcut icon" href="/favicon.ico"> is supported in all browsers. You might still not be seeing it because of caching.

(see this)
I am trying on a completely different computer that has never loaded the site and still nothing

(see this)

It might interest you to know that YouTube and Twitter both use rel="shortcut icon". If you don't believe me, you can go to either site and view page source for yourself.
Just because something isn't in the spec doesn't mean it's not widely supported/used. Browsers tend to have good backwards compatibility for things like this.
Take the <center> tag for example. This tag was deprecated with the release of HTML 4 clear back in 1998. Despite this, it's still supported in every browser, because there's no reason to remove support for it. (And every reason not to.)
I understand that the official, to the spec way of specifying a favicon might differ from what I've done. But it doesn't matter. I think this is important to understand.

I am trying on a completely different computer that has never loaded the site and still nothing

In addition to the meta tag, I've played the favicon at root, which is very standard and widely supported. I genuinely do not know why this would not be working for you.

Hey @terreng I have a quick question not relating to the development of this project. What service do you use to host the website itself? Do you use something like netlify or heroku or something else entirely?

I'm using Cloudflare Pages to host the website. It's static hosting but it supports running a build script first. Pretty sure GitHub Pages can do that now too.
When all you need is basic static hosting, options like Cloudflare Pages, GitHub Pages, or Firebase Hosting are good (among others I'm sure). Static hosting means it's just serving a set list of files / directories.
Heroku isn't the best choice for this because you don't need a full web server (custom web server code) just for static hosting. If you wanted to do something more advanced like generate pages on the server from a database, then you'd need to be able to actually run code in response to http requests. This is what Heroku, App Engine, etc. are designed for.
Let me know if you have any other questions about hosting.

Nope, that's all the information I needed. Thank you!


Allow OG-USA to take general S and J

This PR allows OG-USA to take general S and J. I have tested this on both the steady-state and time path computations for (S=30, J=2) and for (S=80, J=7) and it works perfectly except for the error in the last period resource constraint (1e-03). We think we know what this problem is (nonconvex tax functions) and will remedy it with a different PR.
The steady-state will compute with S=20 and J=1. I assume that fully general S and J would compute if we adjusted our starting values. Most of the changes in this PR were to income.py.

This PR is in reference to Issue #230. That issue includes some of the discussion and tinkering.

I'm concerned about the RC error in the last period.  It looks like the tax functions used are concave - the ETR is constant and the MTRx and MTRy are both concave and only depend on x and y, respectively. I might be misremembering, but I thought we got all RC errors to be tiny with this specification.
A check would be to run through with MTRx and MTRy as constants also.  If that yields a last period RC that is within tolerances, then we know it's the tax functions.  Testing with a small S and J should be quick.

@jdebacker @talumbau , Can either of you two see what is failing in the Travis CI checks of this PR? I can't tell by reading the details. I have checked all the usual suspects like the get_reduced_parameters() function in parameters.py. My suspicion is that I am missing the correct TaxFuncEst_baseline.pkl. In other words, if I have 'age specific':True in my kwargs, then I have to have a TaxFuncEst_baseline.pkl that has age-specific tax functions. My suspicion is that the Travis CI call refers to a tax function that is different from what is saved in the repo. But that is just a guess. Any help on getting this PR to pass Travis CI will be appreciated.

@jdebacker I'll run the test with constant (averaged) tax rates.

I just ran the S=30 and J=2 code with the constant tax rates, and the resource constraint error in the last period is now 5.7e-12. I'll run S=80 and J=7 now to make sure that one works.

@rickecon I see an error about displaying something. Are any of the "show graph" booleans on?

I took a quick look. At least one error is that the code is attempting to create matplotlib figures during a test. The Travis CI environment is not set up to draw these figures so it gets an error. Does it make sense to modify the code so that you can have a flag that turns on drawing the plots but it is off by default (or the other way around and we can modify the tests)?

@talumbau @jdebacker There it is. I had a plotting Boolean left on in the call to inc.get_e_interp() in the parameters.py file (line 689).

@jdebacker @kerkphil , I just finished testing this code with different specifications of the tax functions from txfunc.py and with S=30 and J=2. The only error I ever got was in run #3 in the table below, in which the ETR was a function of both labor and capital income. All the Euler errors and resource constraints in that run were satisfied except for the last period resource constraint error, which was around 1.0e-03.

Run
ETR form
MTRx form
MTRy form
specific ages
combine ages

1
const. avg.
const. avg.
const. avg.
good
good

2
const. avg.
MTRx(x)
MTRy(y)
good
good

3
ETR(x,y)
MTRx(x)
MTRy(y)
bad
bad

4
const. avg.
MTRx(x,y)
MTRy(y)
good
good

5
const. avg.
MTRx(x)
MTRy(x,y)
good
good

6
const. avg.
MTRx(x,y)
MTRy(x,y)
good
good

I take this as validation that this PR is ready to be merged and we just need to implement the new functional form for the tax rate functions such that those functions are monotonically increasing in both labor income and capital income, respectively.


Logout button fixed

"ensure the logout button redirects back to the sign-in page"
i have fixed this part of the issue can i please be assigned partial points.

yeah i get it but a part of the issue has been resolved so please look into it

So that comes under brownie points which are to be allotted only on the successful completion of the original code hence why I said "while you are at it" I am sorry but I have also asked the other maintainers about it and the consensus was points cannot be awarded.


Bug: making all the UI Consistent

Is there an existing issue for this?

[X] I have searched the existing issues

What happened?
Currently the website lacks a consistent look whether it be a form or a card. Creating a overall improved UI that matches the home page
Record

[X] I agree to follow this project's Code of Conduct
[X] I'm a GSSOC'24 contributor
[X] I want to work on this issue

no


Error report from log_info

small fix for  srs_app_server.cpp in function srs_info

fd was not declared

srs_info("listen thread, current_cid=%d, "
        "listen at port=%d, type=%d, fd=%d started success, ep=%s:%d",
        _srs_context->get_id(), port, type, fd, ip.c_str(), port);

change to

srs_info("listen thread, current_cid=%d, "
        "listen at port=%d, type=%d, fd=%d started success, ep=%s:%d",
        _srs_context->get_id(), port, type, listener->fd(), ip.c_str(), port);

Fixed


Extensions "DEPRECATION WARNING" but no documentation

I just realized that I'm getting DEPRECATION WARNING: some_extension is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated! with my extensions, but there is no documentation how to make it in "new way".

You're absolutely right. I will update the documentation as soon as possible.

Just an FYI here - I would also really appreciate some info about what's changing and how to use it! 😁

My fault. I've updated the wiki to reflect the new extension loading mechanism.
Regardless, is some boilerplate code for extensions, with conditional loading and showdown's new proper loading mechanism.
(function (extension) {
  if (typeof showdown !== 'undefined') {
    // global (browser or nodejs global)
    extension(showdown);
  } else if (typeof define === 'function' && define.amd) {
    // AMD
    define(['showdown'], extension);
  } else if (typeof exports === 'object') {
    // Node, CommonJS-like
    module.exports = extension(require('showdown'));
  } else {
    // showdown was not found so we throw
    throw Error('Could not find showdown library');
  }

}(function (showdown) {

  // loading extension into shodown
  showdown.extension('myext', function () {
    var myext = { /* ... actual extension code ... */ };
    return [myext];
  });
}));


Add metamask account reset instructions to README.md

Instructions to reset nonce in order to match ganache are missing at the following location:
Link
For the chrome extension as of metamask 10.12.3 the proper way to do this is by

Opening Metamask Extension
account gravatar in upper right
settings
advanced
"Reset Account" button

I see the instructions now, closing


Feature: Add a hook for before/after all specs run.

After this PR landed, the way specs ran changed quite a bit. Now if you have any at_exit handler in your spec_helper file, that block is ran before your specs instead of at the end.
It's pretty common to have some code you run first thing before all of your specs, and then another bit when all specs have completed running. In the case of LuckyFlow we want to boot up a chromedriver instance, run our specs against that, then when all specs are done, we make sure to shut that process down as well as the HTTP server that's running.
It would be great to have something like:
# Runs once before any actual spec runs
Spec.before_suite do
  setup_test_stuff
end

# Runs once when all specs have completed running (filtered or not)
Spec.after_suite do
  shutdown_test_stuff
end

ref: https://gitter.im/crystal-lang/crystal?at=5d8ba89d63b06968fbea378d
ref: https://github.com/luckyframework/lucky/pull/918/files#diff-e6b95b08ee4663a22e90491d70a0cbdaR131-R154

I also ran into something similar:
require "http/server"
require "http/client"

require "spec"

SERVER = HTTP::Server.new do |context|
  context.response.print "Hello world!\n"
end

def run_server(& : HTTP::Client -> Nil) : Nil
  client = HTTP::Client.new "localhost", 3000
  spawn { SERVER.listen(3000) }
  sleep 0.5
  yield client
ensure
  pp "ensure"
  SERVER.close
end

run_server do |client|
  describe "something" do
    it "works" do
      pp "run client"
      pp client.get "/"
    end
  end
end

# => ensure
# => run client

I would now have to use use the run_server method in every it block, while doable it's def a bit less clean and DRY.

Hmm.. Would that work in crystal 0.31 though? I was thinking since the spec blocks just get gathered up, it looks like it would run the server, collect the specs, close the server, then run the specs at close. Just a guess though.

@jwoertink Right, that's why that example doesn't work on 0.31.0 anymore.  By the time the client.get goes to run, the server is closed.
You would have to wrap each of your it blocks in the run_server method like
describe "something" do
  it "works" do
    run_server do |client|
      pp "run client"
      pp client.get "/"
    end
  end
end

Ah right. That makes sense.

This is kinda where having like beforeEach/beforeAll and afterEach/afterAll would be helpful, like https://jasmine.github.io/api/3.5/.

Or we can wrap all the it inside a block:
def some_stuff(&block)
  init
  yield
  clean
end
some_stuff do |stuff|
  it ...
    stuff.should eq ...
  end
end

@j8r No, that doesn't work. init and clean will run before running it. it runs separately at the end of the program.

Has anyone found a solution for this yet? Executing all setup and teardown for every spec increases run time for large projects enormously. Like slower than 2010 Rails with RSpec :(

You mean, the crystal-db way? I think for crystal db a single connection should be made and each spec would check out a connection from the pool. If that's not the case it should be improved.
Or what do you mean?

@asterite My understanding of the "crystal-db way" is that it still creates required resources before each it.
@bcardiff wrote above:

In crystal-db a new kind of it is defined that yield a db instance. That means the resource is created for each it. But is less verbose.

This is a problem as there are a lot of specs in Amber for testing generators, which generate a project and then check that it was generated correctly per the option provided. It also checks that it compiles and runs. If we have to generate the project before every it it takes substantially longer to run.
All of these specs have worked fine for the last 2 years, but we're still debating how to get all of our tests to pass with crystal 0.31.x. Preferably we can find a way to do it similarly to before.

To clarify, I meant the specs that are used in each db driver. mysql and sqlite specs use the helper at https://github.com/crystal-lang/crystal-db/blob/master/src/spec.cr#L468 to write specs as https://github.com/crystal-lang/crystal-mysql/blob/master/spec/db_spec.cr . Is not something that affect specs using crystal-db.

Thanks. I'm looking through that. This isn't quite the same situation but could probably follow the same pattern.
In this example how would I have the file only be created and deleted once?
require "spec"

module FileHelper
  extend self
  def create_file
    puts "writing file"
    File.write("testfile.txt", "this is here")
  end

  def delete_file
    puts "deleting file"
    File.delete("testfile.txt")
  end
end

describe "makefile" do
  Spec.before_each do
    FileHelper.create_file
  end

  it "works" do
    File.read("testfile.txt").should eq "this is here"
  end

  it "adds to file" do
    File.open("testfile.txt", "a") do |f|
      f << " too."
    end

    File.read("testfile.txt").should eq "this is here too."
  end

  Spec.after_each do
    FileHelper.delete_file
  end
end

I don't think it's good to share state between tests. For example this will prevent running them in parallel in the future (if we want to eventually do that).
I plan to add before_each, before_all, after_each, after_all and maybe around_each and around_all to spec, would that help?

(of course if we add those methods there would still not be a way to share things created between a hook and a spec, well, only through a name like a known filename in your examplel

And again, I really wouldn't mind reverting the refactor that caused this breakage. I think that the spec before the refactor was simpler:

things run from top to bottom
if you want to do some set up for a group of specs, you just do it before the it blocks and clean up after the it blocks

The refactor might enable:

parallel test runs
randomized test runs
focus
maybe other things?

So maybe the simplicity was overall better. If we go this route (the current way) we'll need to add before_each, before_all, etc., which is what the original spec didn't want to have because of how convoluted things become this way.
What do you think?
Again, I really wouldn't mind reverting the refactor. After all we are not 1.0 yet and we are free to experiment, do and undo things.

@asterite I agree that it's generally not a good idea to share state between tests. However there are cases where setup and tear down are simply too expensive to do every time.

For example this will prevent running them in parallel in the future (if we want to eventually do that).

This could probably done with an option and parallel or random order tests would ignore before alls.

I plan to add before_each, before_all, after_each, after_all and maybe around_each and around_all to spec, would that help?

Probably. I'm used to before and after in minispec and rspec. In my opinion it would make sense for before_all, before_each, after_all, after_each to be run within the scope of the describe they're nested in rather than global with Spec.before_each. In the past we moved to just listing things from top to bottom in the spec and it was a good work around.
Personally I was happy enough with the way spec was before. I could see an advantage to going to something more standard though with befores confined to their describe blocks.

Yes, I mean hooks confined to each describe (and nested describes). It's really easy to implement now. I'll probably send a PR for that next week if I have time.

@asterite Thanks a lot. I really love working in the Crystal community and appreciate that part you play in keep crystal great while improving it. We've written a lot of crystal at my work including the Infotainment System and Instrument Cluster in these trucks and am excited about the future. https://www.youtube.com/watch?v=u4mnYkH8ntc
Maybe we'll just hold off on fixing the Amber CLI specs until the next release of crystal.

@elorest do you share variables between specs? What I mean is, create something before a group of it blocks and then use it inside them. I ask because in the current spec, even with hooks, that's not possible.

We don't share variables between specs. Within a describe block we're fine with them running in any order. However we have been defining multiple variables which are used by all it blocks so that the values don't have to be defined multiple times. For example:
describe "files" do
  filename = "testfile"

  it "reads file" do
    #something with filename
  end

  it "adds to file" do
    #adds to file and checks.
  end
end

Is that what you're saying isn't possible? If that's the case it would still be easy enough to call a function to define them all in each block.

I think that's still possible. It's just that it's hard to do some clean up after tests finish, I think.

I was thinking how to implement let from RSpec, or at least something similar: how to have a variable be created once for each spec, or once for all specs.
With before_each we could do:
describe "foo" do
  a = 0
  before_each do
    a = rand(1..10)
  end

  it "..." do
    puts a # => 4
  end

  it "..." do
    puts a # => 9
  end
end

That's not bad but it requires a bit of boilerplate:

we need to declare the local variable
we need to initialize it to some initial, uninteresting, value
we need to assign it a value in the before each

I was thinking of a macro let, like this:
macro let(var)
  {{var.id}} = uninitialized typeof({{yield}})

  before_each do
    {{var.id}} = {{yield}}
  end
end

Essentially, writing:
let(a) { rand(1..10) }

would expand to:
a = uninitialized typeof(rand(1..10))

before_each do
  a = rand(1..10)
end

But that doesn't work: if we write
describe "foo" do
  let(a) { rand(1..10) }

  it "..." do
    puts a
  end
end

then Crystal will think that a is a method call, not a variable, because it doesn't see a = ... anywhere in the code.
However, I just thought that we could have something like:
let a = rand(1..10)

so the parser will see a = ... and see it as a variable. It works!
So that's kind of nice because let is a super simple macro, so even if we use it like all over the place it will work fine.
But there are other problems:

if you use a outside of an it you will read the uninitialized value, which might lead to a segfault
there's no way to redefine a let in a nested scope (but that might be a feature)

I'm still scratching my head thinking how we can have a variable be shared and initialized every time before each or all specs in a describe section... it needs a bit more thought, but maybe it's possible!
Another idea is to abandon the idea of referring to the variable by just doing a and instead doing something like a.get: that would raise an exception if called outside of an it, and we could also lazily initialize the value. Maybe it's not that bad, and it would also make it clear that a isn't a regular variable but a spec-related variable (in big RSpec it's hard to find out which things that looks like xyz are local variables or let-variables).

So this is working:
require "spec"

class Spec::Var(T)
  def initialize
    @has_value = false
    @value = uninitialized T
  end

  def value=(@value : T)
    @has_value = true
  end

  def get : T
    raise "let-var used outside of `it`" unless @has_value
    @value
  end
end

macro let(assignment)
  {{assignment.target}} = Spec::Var(typeof({{assignment.value}})).new

  before_each do
    {{assignment.target}}.value = {{assignment.value}}
  end
end

describe "foo" do
  let a = rand(1..10)
  let b = a.get + 100

  it "lele" do
    p! a.get
    p! b.get
  end

  describe "coco" do
    let a = rand(30..40)

    it "lala" do
      p! a.get
      p! b.get
    end

    it "lele" do
      p! a.get
      p! b.get
    end
  end
end

I get:
a.get # => 4
b.get # => 104
.a.get # => 34
b.get # => 108
.a.get # => 32
b.get # => 110

(and I have local changes to support before_each)
I'm not sure using get is nice, plus if you don't use it it will refer to the Spec::Var thing, but maybe it's not thaaat bad...

If let is called at the top of describe block instead of inside of a hook, is there really any advantage to using let instead of:
describe "foo" do
  a = rand(1..100)
  b = a + 100

  it "lele" do
    p! a
    p! b
  end
end

Either way it looks very usable.

@elorest The difference is that in my example a will get a different random number in each it block, while in yours it's always the same value.
I'm also thinking that if let defines something that is lazily computed and for which you must call get to get its value, eventually it could be a per-spec instance so that its value is not shared with other specs to allow parallel runs... but I'm not super sure about that.

I actually do this to initiate a state for certain specs, then removing it at the end:
require "spec"
require "file_utils"

def spec_with_tempdir(directory : String = File.tempname)
  Dir.mkdir directory
  begin
    yield directory
  ensure
    FileUtils.rm_rf directory
  end
end

def spec_with_file
  spec_with_tempdir do |dir|
    file = (Path[dir] / "test").to_s
    File.write file, "data"
    yield file
  end
end

spec_with_file do |file|
  it "does something" do
    file.should be_a String
  end

  it "does another thing" do
    File.read(file).should eq "data"
  end
end

This example use a file, but in my side I also use this this to test different aspects of an object in read-only, or to use a temporary directory to do the the tests then removing it.

@j8r You do know that your example doesn't work well with the latest Crystal/spec version, right?
(I ask because you keep suggesting that solution, but that doesn't work anymore)

@asterite Yeah that would definitely be useful. Although it would be really easy to add that pattern with scoped before_each, before_all etc. Thanks for you help.

It is working @asterite, I have just re-checked.

Hum, yeah it's working when running the all suite but not when running specific specs like crystal spec test.cr:22.
It can be considered as an imperfect work-around.

@j8r if I run your example I get:
.E

Failures:

  1) does another thing

       Error opening file '/var/folders/10/wk6sdnpd4lg0wc7_b56q6ksr0000gn/T/20191006-99266-5gt0qa/test' with mode 'r': No such file or directory (Errno)

What Crystal version are you using?
Here's what happens: it will capture a block and at the end of the program it will be executed. So your spec_with_tempdir  will create the directory, capture the it block, delete the directory, and later when it is executed the tempdir won't exist anymore.

Oh ok nevermind, you're right. This logic is only working for my use case, where I need a temporary directory to create an object, then the path can be trashed out.


Generated ampli client fails type checking for events with only optional properties

Expected Behavior
The client generated from the ampli CLI should not produce any type errors for events with only optional properties with exactOptionalPropertyTypes on.
Current Behavior
Events generated by ampli that only contain optional properties show the following TypeScript error
Class 'PlaceOrderButtonClicked' incorrectly implements interface 'BaseEvent'.
  Types of property 'event_properties' are incompatible.
    Type 'PlaceOrderButtonClickedProperties | undefined' is not assignable to type '{ [key: string]: any; }'.
      Type 'undefined' is not assignable to type '{ [key: string]: any; }'.ts(2420)

Example generated event
export class PlaceOrderButtonClicked implements BaseEvent {
  event_type = 'Place Order Button Clicked';

  constructor(
    public event_properties?: PlaceOrderButtonClickedProperties,
  ) {
    this.event_properties = event_properties;
  }
}

Possible Solution
The BaseEvent class should have event_properties defined as event_properties?: { [key: string]: any } | undefined;
Steps to Reproduce

Enable exactOptionalPropertyTypes in tsconfig.json.
Create an event with all optional properties.
Run ampli pull to generate the client
Run type checking with tsc --noEmit on the project

Environment

ampli Version: @amplitude/ampli/1.31.2 linux-x64 node-v16.19.1
JS SDK Version: 1.9.1
Installation Method: yarn
TypeScript version: Version 4.9.3
tsconfig.json: https://github.com/tsconfig/bases/blob/main/bases/next-strictest.json
Browser and Version: N/A

Came across another issue with exactOptionalPropertyTypes enabled.
Let's say you have some object with the type { foo?: string } and an event Test Event that takes foo_property as an optional property as well as some other properties that may or may not be required.
If you try to do this:
ampli.testEvent({ foo_property: obj.foo, other_a: "a", other_b: "b" });

You'll get the error: Type 'undefined' is not assignable to type 'string'.ts(2379).
Instead, you have to do this:
ampli.testEvent({
  other_a: "a",
  other_b: "b",
  ...(obj.foo ? { foo_property: obj.foo } : {}),
});

It works, but is very verbose and annoying to write. In this example, foo_property should be defined as foo_property?: string | undefined instead of just foo_property?: string.


Install version of ome.omero_web role with upgraded pip in venv

Also upgrade other roles to the latest released versions
This fix depends on https://github.com/ome/ansible-role-omero-web/pull/41 and is required to fix the broken CI builds (see https://github.com/sbesson/omero-web-docker/runs/3919241143?check_suite_focus=true)

Conflicting PR. Removed from build DOCKER-merge#1621. See the console output for more details.
Possible conflicts:

PR #54 manics 'Move unnecessary deps from production image into devtest image'

requirements.yml

--conflicts