Couldn’t connect with atlas database

when I tried to connect to an atlas database using:
import { MongoClient } from<EMAIL_ADDRESS>const client = new MongoClient();
await client.connect(
	"mongodb+srv://Eyoatam:" +
		Deno.env.get("MONGO_ATLAS_PASSWORD") +
		"@cluster0.xrb4d.mongodb.net/<dbname>?retryWrites=true&w=majority"
);

It threw the following error:
error: Uncaught (in promise) Error: failed to lookup address information: nodename nor servname provided, or not known
    at processResponse (deno:core/core.js:223:11)
    at Object.jsonOpAsync (deno:core/core.js:240:12)
    at async Object.connect (deno:cli/rt/30_net.js:224:13)
    at async MongoClient.connect (client.ts:41:14)
    at async app.ts:4:1

is there another way to connect with mongodb atlas?

you miss the db name

you miss the db name

you miss the db name

No I didn’t , the db name is cluster0

you miss the db name

No I didn’t , the db name is cluster0

do you set mongo ip ?

do you set mongo ip ?

Uncaught (in promise) ConnectionRefused: No connection could be made because the target machine actively refused it. I have this issue ... while I am trying.
Any idea ? @Eyoatam

Uncaught (in promise) ConnectionRefused: No connection could be made because the target machine actively refused it. I have this issue ... while I am trying.
Any idea ? @Eyoatam

do you set mongo ip ?

Everything is set, I guess the problem is the library (deno_mongo), doesn’t support mongodb atlas.

do you set mongo ip ?

Everything is set, I guess the problem is the library (deno_mongo), doesn’t support mongodb atlas.

denodb work perfect with mongo, even though I have to figure out the find ,delete operations.  The select all work fine. ( may be my fault)

denodb work perfect with mongo, even though I have to figure out the find ,delete operations.  The select all work fine. ( may be my fault)

I will post the repo when I figure it out ,

I will post the repo when I figure it out ,

Even without the "+srv" in the connection string the driver does work.
In the image attached you can see the full uri to connect without SRV displayed by Atlas to connect to replica set.
mongodb://<username>:<password>@princesapeach-shard-00-00.h8z8n.mongodb.net:27017,princesapeach-shard-00-01.h8z8n.mongodb.net:27017,princesapeach-shard-00-02.h8z8n.mongodb.net:27017/<dbname>?ssl=true&replicaSet=PrincesaPeach-shard-0&authSource=admin&retryWrites=true&w=majority

import { MongoClient } from "https://deno.land/x/mongo@v0.21.2/mod.ts";;
import env from "./src/setup/env.ts";

const client = new MongoClient();
const url = `mongodb://${env.dbUser}:${env.dbPass}@princesapeach-shard-00-00.h8z8n.mongodb.net:27017,princesapeach-shard-00-01.h8z8n.mongodb.net:27017,princesapeach-shard-00-02.h8z8n.mongodb.net:27017/${env.dbName}?ssl=true&replicaSet=PrincesaPeach-shard-0&authSource=admin&retryWrites=true&w=majority`;
console.log('url', url);
await client.connect(url);
const names = await client.listDatabases();
console.log('names', names);
client.close();

error: Uncaught (in promise) AssertionError
    throw new AssertionError(msg);
          ^
    at assert (asserts.ts:170:11)
    at WireProtocol.receive (protocol.ts:80:7)

Deno 1.5.4

Even without the "+srv" in the connection string the driver does work.
In the image attached you can see the full uri to connect without SRV displayed by Atlas to connect to replica set.
mongodb://<username>:<password>@princesapeach-shard-00-00.h8z8n.mongodb.net:27017,princesapeach-shard-00-01.h8z8n.mongodb.net:27017,princesapeach-shard-00-02.h8z8n.mongodb.net:27017/<dbname>?ssl=true&replicaSet=PrincesaPeach-shard-0&authSource=admin&retryWrites=true&w=majority

import { MongoClient } from "https://deno.land/x/mongo@v0.21.2/mod.ts";;
import env from "./src/setup/env.ts";

const client = new MongoClient();
const url = `mongodb://${env.dbUser}:${env.dbPass}@princesapeach-shard-00-00.h8z8n.mongodb.net:27017,princesapeach-shard-00-01.h8z8n.mongodb.net:27017,princesapeach-shard-00-02.h8z8n.mongodb.net:27017/${env.dbName}?ssl=true&replicaSet=PrincesaPeach-shard-0&authSource=admin&retryWrites=true&w=majority`;
console.log('url', url);
await client.connect(url);
const names = await client.listDatabases();
console.log('names', names);
client.close();

error: Uncaught (in promise) AssertionError
    throw new AssertionError(msg);
          ^
    at assert (asserts.ts:170:11)
    at WireProtocol.receive (protocol.ts:80:7)

Deno 1.5.4

@marcodali
On the basis that you get the complete node information. Currently, only one node can be selected to connect (please select the master node),
for example:
const client = new MongoClient();
const url = `mongodb://user:pwd@princesapeach-shard-00-02.h8z8n.mongodb.net:27017/db?retryWrites=true&w=majority`;
await client.connect(url);

@marcodali
On the basis that you get the complete node information. Currently, only one node can be selected to connect (please select the master node),
for example:
const client = new MongoClient();
const url = `mongodb://user:pwd@princesapeach-shard-00-02.h8z8n.mongodb.net:27017/db?retryWrites=true&w=majority`;
await client.connect(url);

Hi everyone, I was trying to connect to the Atlas database. I have tried all the possible solutions above. finally, I can connect with this way
await client.connect({
    db:'<db>',
    tls:true,
    servers: [
        {
            host: 'cluster0-shard-00-02.soz4m.mongodb.net',
            port: 27017
        }
    ],
    credential: {
        username:"<username>",
        password: '<pwd>',
        db: '<db>',
        mechanism:'SCRAM-SHA-1'
    }
})

Hi everyone, I was trying to connect to the Atlas database. I have tried all the possible solutions above. finally, I can connect with this way
await client.connect({
    db:'<db>',
    tls:true,
    servers: [
        {
            host: 'cluster0-shard-00-02.soz4m.mongodb.net',
            port: 27017
        }
    ],
    credential: {
        username:"<username>",
        password: '<pwd>',
        db: '<db>',
        mechanism:'SCRAM-SHA-1'
    }
})

This don't work for me.
They can't somehow fix it so that it gets overloaded and the uri can be put back as a string, like it could be done before

Hi everyone, I was trying to connect to the Atlas database. I have tried all the possible solutions above. finally, I can connect with this way
await client.connect({
    db:'<db>',
    tls:true,
    servers: [
        {
            host: 'cluster0-shard-00-02.soz4m.mongodb.net',
            port: 27017
        }
    ],
    credential: {
        username:"<username>",
        password: '<pwd>',
        db: '<db>',
        mechanism:'SCRAM-SHA-1'
    }
})

I haven't had any success.
It is either:
Error: MongoError: {"topologyVersion":{"processId":"601480457f8872e51ff2e12f","counter":4}

or
Error: MongoError: {"ok":0,"errmsg":"noTimeout cursors are disallowed in this atlas tier","code":8000,"codeName":"AtlasError"}

You should set your primary cluster address to host. After that, It should connect successfully. I think you are getting an error while finding objects.
Can you try this? It works for me.
interface Room {
  _id?: { $oid: string };
  name: string;
  owner_id: string;
}

const rooms = db.collection<Room>('rooms');
const myRoom = rooms.find({}, {
      noCursorTimeout: false,
} as any);

@berkaygure Yeah, it works, thank you.
@manyuanrong Any reason not to expose the noCursorTimeout property of the FindOptions interface?

If @berkaygure approach still gives the same Error: failed to lookup address information: nodename nor servname provided, or not known
Make sure your host URL is taken from the below steps:

Credits @tavadur

Just tried connecting again with deno_mongo
Did not work out
ATTACHING RELEVANT CODE AND SCREENSHOT BELOW
`import { MongoClient } from "../deps.ts";
import "https://deno.land/x/dotenv/load.ts";
const client = new MongoClient();
client.connect(
"mongodb://admin:adminadmin@merncluster-shared-bla-01.blablabla.mongodb.net:27017"
);
// DB URL IS FAKE
const db = client.database("deno_survey");
export const usersCollection = db.collection("users");
`

@manojap @Eyoatam @ShubhamPalriwala @manyuanrong can  you guys help me please?

Hi everyone, I was trying to connect to the Atlas database. I have tried all the possible solutions above. finally, I can connect with this way
await client.connect({
    db:'<db>',
    tls:true,
    servers: [
        {
            host: 'cluster0-shard-00-02.soz4m.mongodb.net',
            port: 27017
        }
    ],
    credential: {
        username:"<username>",
        password: '<pwd>',
        db: '<db>',
        mechanism:'SCRAM-SHA-1'
    }
})

Try this @nooobcoder
Credits @berkaygure

Hi everyone, I was trying to connect to the Atlas database. I have tried all the possible solutions above. finally, I can connect with this way
await client.connect({
    db:'<db>',
    tls:true,
    servers: [
        {
            host: 'cluster0-shard-00-02.soz4m.mongodb.net',
            port: 27017
        }
    ],
    credential: {
        username:"<username>",
        password: '<pwd>',
        db: '<db>',
        mechanism:'SCRAM-SHA-1'
    }
})

Try this @nooobcoder
Credits @berkaygure

@ShubhamPalriwala what should i write here? What to write in place of <db> ?
db:'<db>',

@nooobcoder write your DB name that you initialised on Mongo Atlas

Someone already has a functional way to connect to mongo atlas with this module, it is a bit stressful to want to connect mongo atlas and not have a module in deno that works correctly

closed by #198

Someone already has a functional way to connect to mongo atlas with this module, it is a bit stressful to want to connect mongo atlas and not have a module in deno that works correctly

Although pr #198 was meant to resolve the MongoDB Atlas connection problem, it did not work as expected in my case. As a workaround, I have implemented the following code that effectively determines the active and operational replica among the three replica instances in MongoDB Atlas shared clusters.
/**
 * Determines the active and functioning replica among the three
 * replica instances in MongoDB Atlas shared clusters.
 * The replica instances take turns being active at different
 * times as they rotate. The script establishes a connection with
 * each replica instance and checks whether it is available and
 * responsive. If an active replica is found, its URI is returned.
 * If none of the replica instances are available, an error is thrown.
 *
 * @param mongoUri - The URI of the replica instance to check.
 * @returns The URI of the active replica instance.
 */

import { MongoClient } from "../../deps.ts";

import {
  mongoUri1,
  mongoUri2,
  mongoUri3,
  mongoDbName,
  mongoDbUsername,
  mongoDbPassword,
} from "../config/global.ts";

const mongoUris = [mongoUri1, mongoUri2, mongoUri3];

async function checkEndpoint(mongoUri: string) {
  const client = new MongoClient();
  try {
    await client.connect({
      db: mongoDbName,
      tls: true,
      servers: [
        {
          host: mongoUri,
          port: 27017,
        },
      ],
      credential: {
        username: mongoDbUsername,
        password: mongoDbPassword,
        db: mongoDbName,
        mechanism: "SCRAM-SHA-1",
      },
    });
    await client.listDatabases();
    return mongoUri;
  } catch {
    return null;
  } finally {
    await client.close();
  }
}

async function checkEndpoints() {
  const endpointChecks = mongoUris.map((mongoUri) => checkEndpoint(mongoUri));
  const results = await Promise.allSettled(endpointChecks);
  const availableUri = results
    .filter((result) => result.status === "fulfilled")
    .map((result) => (result as PromiseFulfilledResult<string | null>).value)
    .find(Boolean);

  if (availableUri) {
    return availableUri;
  }

  throw new Error("No mongoUri is available");
}

export default checkEndpoints;


Implemented and tested rstrip,lstrip,strip functions.Edited the test_str file accordingly

The rstrip and lstrip functions had bugs
.For eg: print('abbccbbaaac'.lstrip('ab')) should ideally print 'ccbbaaac' whereas it prints 'bccbbaaac' and print('abbccbbaaac'.rstrip('ac')) should print 'abbccbb' whereas it prints 'abbccbba'..
Corrected them and used these functions to implement strip() successfully

Will edit test_str and edit style( specifically remove extra white spaces )..later will create a new PR.


Enable telemetry with external control plane

Please provide a description of this PR:

@frankbu: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Rerun command

release-notes_istio
d1fad329becddc9b10e8e5957b8f72c357f4c2bd
link
/test release-notes_istio

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

/test integ-telemetry-istiodremote-tests_istio

@frankbu: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Rerun command

release-notes_istio
d1fad329becddc9b10e8e5957b8f72c357f4c2bd
link
/test release-notes_istio

integ-istiodremote-k8s-tests_istio
d1fad329becddc9b10e8e5957b8f72c357f4c2bd
link
/test integ-istiodremote-k8s-tests_istio

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@frankbu: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Rerun command

unit-tests_istio
f795e61c900278aae0b1c800e2ccd0ad8573d024
link
/test unit-tests_istio

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

/retest


Allow "nikic/php-parser":"^3.0" in 1.3

Can you allow version ^3.0 of  nikic/php-parser in version 1.3 of Jane Open Api? I'm using docker-php which requires version ^1.3, though I need php-parser 3 to extract translation IDs from PHP7 files.

IMO you can do an alias for that : "nikic/php-parser": "3.0 as 1.4" and it should work

Thanks. Didn't know that. Though it has one drawback: a specific version of php-parser has to be defined.
Btw, the aliasing doesn't seem to work with conflicts:
$ composer require --dev 'friendsofphp/php-cs-fixer:2.8.1 as 2.0.0-alpha'
fails because of conflicts:

friendsofphp/php-cs-fixer v2.8.1 conflicts with jane/open-api[v1.3.0]


New UI, some improvments

an OpenCellId API key is requested when enabling OpenCellId as source (and there is not yet an API key)
there are new strings which are not yet translated to Serbian
at "/app/src/main/assets/mcc.txt" is a MCC list used for the area chooser which is not yet complete

Overall very nice. I had a situation when building the database where the screen timed out because of no user activity and when I unlocked the screen it seemed to require restarting the database creation.
I will accept it with that possible bug and will release it as a new version and I will augment the mcc.txt file with more country code to MCC mappings from Wikipedia.

I tried it 3 times with the screen timeout and it continued creating the database. If you try it again, happens it again?
It should continue creating the database if the Activity is destroyed (and reconnect with the Service if the Activity is created again).

It only happened once for me and I was also unable to duplicate it.


Tensorboard Embedding Projector Custom Search Bug

Context: I am using the online version of the Tensorboard Embedding Projector. I uploaded my own checkpoint and metadata TSVs with 681909 rows each. I clicked on the "CUSTOM" tab, and then found a bug when I tried to search.
Current Behavior/Bug: I am unable to click on the search bar that says "Search by". When I do click anywhere in the search bar, a drop down appears with the option "label". If I click label and try to search again, there is no difference. There is no error message.
Expected Behavior: I would be able to search, or be given an error message indicating why I'm unable to.

@pujaarajan ,
This looks like tensorboard related issue, could you please report issue in Tensorboard repo. Also close this issue once its reported there. Thanks!


See Resolve Windows 10 upgrade errors

There needs to be a clearer differential of "See Resolve Windows 10 upgrade errors" in terms of what you are talking about as to "See Resolve errors in upgrading to Windows 10" as opposed to "See Resolve Windows 10 errors in Windows Upgrades".
More clarity is needed is need to explain whether the article refers to upgrading "to Windows 10" or "windows 10 upgrades within Windows 10".
Reference:
https://docs.microsoft.com/en-us/windows/deployment/upgrade/log-files
[Enter feedback here]

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

ID: 5aed724a-73f2-3b93-d273-8b8302086ea1
Version Independent ID: 728c8856-ee32-1ba9-a0c4-4a5791f89a89
Content: Log files and resolving upgrade errors - Windows Deployment
Content Source: windows/deployment/upgrade/log-files.md
Product: w10
Technology: windows
GitHub Login: @greg-lindsay
Microsoft Alias: greglin

The article is about upgrade errors.  The upgrade process occurs any time the operating system version changes.

What is this supposed to mean please, upgrades to Windows 10 or upgrades within Windows 10?
As I stated, is it about upgrading to Windows 10, from a version prior to Windows 10 i.e. Windows 7, or is it about upgrades within Window 10?  If it is the later, I’m not sure logs within, for example the the Panther folder, are relevant.
From: Greg Lindsay
Sent: Wednesday, August 18, 2021 7:23 PM
To: MicrosoftDocs/windows-itpro-docs
Cc: jacobjjjj ; Author
Subject: Re: [MicrosoftDocs/windows-itpro-docs] See Resolve Windows 10 upgrade errors (#9913)
The article is about upgrade errors. The upgrade process occurs any time the operating system version changes.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
--
This email has been checked for viruses by AVG.
https://www.avg.com


use su-exec instead of gosu

https://github.com/ncopa/su-exec
simpler/lighter ... easier to install ... want a PR ?

yes, please PR will be helpful

could you merge any of the 4 open PRs before I make a new one ?

@grosser thank you for PR


*splat on arrays

In Ruby, I can expand an array to an argument list:
a = [1,2,3]
puts *a     # equivalent to puts(1,2,3)

I cannot do this in Crystal, because splats only work with tuples. Unfortunately, tuples can't be dynamically created like arrays can:
a = [1,2,3]
a << 4
puts *a    # puts(1,2,3,4)

So essentially, the splat is pretty much useless. Any chance of array support?
Come to think of it....dynamic tuples would be awesome as well. Essentially arrays with different types for each element:
a = {"fred", 26}
a << 3.14
puts *a     # a string, an int, and a float

Using tuples for splat allows using tuples as arguments to methods, so you can for example forward them between methods. Using arrays won't work because their length is not know at runtime, and they mix all types.
There's no way the compiler can figure out how to expand that puts *a because it won't know the number of arguments.  For puts we could add an overload that accepts an array (or enumerable), and print each of them. Then you can just do puts a and the array overload will be selected. I think this is what Ruby does (obviously without overloads, just runtime checks), so if you do puts [1, 2, 3] it's like calling puts(1, 2, 3)... but that's not very intuitive, so we chose (for now) not to do that.
Maybe puts is a bad example. There's for example File.join which accepts a splat, and also array/tuple (maybe it should be enumerable). So you can do:
File.join "foo", "bar", "baz"

paths = {"foo", "bar"}
File.join *paths

paths = ["foo", "bar"]
File.join paths

This means that you can always provide a splat version and an array version for your methods, if you think it makes sense to pass multiple arguments.
For your particular case, you can do a.each { |e| puts e }. I know it's longer, but there's no way to do it with splats.

Ah. So, essentially, a Tuple is an array where the length and parameter types are known at compile-time?
But isn't the type of an array known at compile-time also? Not the length, obviously.
Incidentally, how would I go about creating an untyped array? Like, an array whose elements may be of any type?
Furthermore, is there some neat, convenient way (possibly with macros?) of having a hash table whose values can be of different types? For example, if I say hash[:name] = "Fred" and hash[:age] = 25, the compiler will know that hash[:age] is an integer?

Create un untyped array: you can't, this is a typed language. In the future you might be able to say Array(Object) but to invoke methods on the objects you'll have to cast them to the type you expect them to be.
And there's no way to create that hash table you want. But classes/struct with methods and types solve the problem, and they give you type safety. You can define [] to check at runtime "if it's 'name' then name, if it's "age" then age, otherwise raise an error", if that's what you really want to. For example this. But unless you really need that dynamism, your code will end up being slower, harder to understand, and will probably have more runtime errors that won't be, of course, catched at compile time.

Yeah, a normal struct would probably be a better option. Oh well.


Allow many assemblies to contribute IMigrations in the same migrations run

See: https://github.com/schambers/fluentmigrator/issues/463 for the original issue that I created.
In short: not all of our migrations are in the same assembly. This is deliberate as our application is very modular in nature and a module is able to define its own (very specific to its need) tables and other database objects, so migrations are present in several assemblies. Currently, it's only possible to do this through iterating through all your migration assemblies and creating a separate runner for each one, which doesn't necessarily run the migrations in the correct order.
I've made a change that preserves current functionality (you can still pass in a single Assembly instance to the runner) but adds the ability to also provide a IAssemblyCollection instance. The current overloads that accept a Assembly parameter default to creating a implementation of IAssemblyCollection, namely SingleAssembly.
I've tried to keep breaking changes to a minimum, but to preserve sensical naming I've had to rename properties that are part of the public API to "Assemblies" instead of "Assembly".

@JulianRooze How does this work, it's just  a runner change for programmatic access ?

@tommarien Yes, basically, that's how the change is exposed to the outside. We use a console application as our migration runner that scans all loaded assemblies for IMigration implementations and feeds those assemblies to the standard MigrationRunner, which now also accepts a IAssemblyCollection.
Internally, places that previously accepted an Assembly instance now accept a IAssemblyCollection which is then used to aggregate all migrations from all those assemblies into a single feed. The only two things that were ever accessed on Assembly were GetExportedTypes (to find the implementations of IMigration) and GetManifestResourceNames (for accessing assembly embedded SQL scripts) which have been exposed on the IAssemblyCollection as well.

@JulianRooze i would consider merging it in if the code was 100% backwards compatible
What i mean is that for instance the msbuild runner should have both options still open : old style 1 assembly and new multiple assemblies for instance
Any chance you can create a branch from our source and reincorperate the changes in a backwards compatible way ?

The MsBuild changes were a contribution by @esakal. I'll take a look if I can make that backwards compatible.
How do you suggest I approach keeping the naming backwards compatible while keeping them sensical? I did a lot of renaming in 28d02b81 because naming something typed IAssemblyCollection with a singular name like "Assembly" doesn't make a lot of sense, so I pluralized those to "Assemblies".
I suppose I could expose both a property of type Assembly called "Assembly" and a property of type IAssemblyCollection called "Assemblies". Would that be okay? And how would that Assembly property behave when the migration uses multiple assemblies? Throw an exception, return the first assembly?

@JulianRooze i just quickly checked the change by esekal, it already looks backward compatible, i guess all should be fine

Okay, thanks for the check. Let me know if you need me to make any changes to make this mergeable.

@JulianRooze Thanks Julian, seems to run fine ;)


Destructuring assignment problem on some old browsers

There is a problem on some some old browsers with the destructuring assignment. Babel 6 use object.assign() if the browser support this function and a custom function for others. But, browser like ios safari 7, accept object.assign() but not support it.
So I guess, to fix it, we would have to update Babel 6 to Babel 7.
Thank you very much.

Hi @Draktors 👋🏽
As you mentioned, tweaking your babel configuration to either use a later version, or transpile/polyfill to add support would be the way to do if I understand correctly.

@mtliendo I've been thinking about the awkwardness of publishing non-ES5 and how it hasn't really caught on as far as I can tell, and while searching for popular packages that do publish non-ES5 I found this as an example.
However, I don't see any warnings in the documentation site about transpiling this package.  Right now the webpack docs still have examples of excluding node_modules and big advice to exclude it if babel is slow.  So transpiling anything inside node_modules is still not mainstream and package authors should document if users will need to transpile their package.


Enable multi-module workspace support

Follow-up to #2304
This helps devs to work on both modules at the same time. It does not impact builds or anything else.
CI needs to be updated to recognize multi-module.

/override ci/prow/ocs-operator-ci
This test is redundant with github-actions test and is being removed by #2328 .


Consider using a listeners pool

Currently, even if running in coroutines and using channels to distribute the workload, the entire application is (essentially) single-threaded, as we only start one coroutine per task (listener, pub/sub, etc.)
We should explore the possibility of running the workers concurrently - however, this opens up the possibility of race conditions for events which, even if arriving in order from SQS, may become out-of-order (and cause unwanted issues, with transitions being deemed invalid, incorrectly).
It is non-obvious how to "single-thread" per FSM, while keeping independent event stream running concurrently.

See also #58


some question about the auc score

Hi, thanks for your excellent work!
I saw in your code that you calculate the AUC score using gt_labels and total_topk_err_scores.
auc_score = roc_auc_score(gt_labels, total_topk_err_scores)
Can I use gt_labels and pred_labels to calculate the AUC score

When you already have pred_labels (0 or 1), you should evaluate other metrics, like precision instead of AUC. AUC can be seen as an average performance metric under different thresholds (these thresholds will decide 0 or 1 labels).

When you already have pred_labels (0 or 1), you should evaluate other metrics, like precision instead of AUC. AUC can be seen as an average performance metric under different thresholds (these thresholds will decide 0 or 1 labels).

i get it，thank you！


Update libssh2-sys's build script

The builds on the linux bots are currently broken because the recent
modifications to this build script forgot to set up PKG_CONFIG_PATH for custom
installations of OpenSSL

@bors: r+ 3f95b7d

:scream_cat: 3f95b7d is not a valid commit SHA. Please try again with 3f96b7d.

r? @huonw
(rust_highfive has picked a reviewer for you, use r? to override)

@bors: r+ 3f96b7d

:hourglass: Testing commit 3f96b7d with merge 14e15f0...

:sunny: Test successful - cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64


Fix small error in the description

The text in the description should be primary instead of secondary

Thank you


feat: allow delete schema while it has relation fields

feat: allow delete schema while it has relation fields

LGTM


Webview component override docs

Thanks for submitting a PR! Please read these instructions carefully:

[ ] Explain the motivation for making this change.
[ ] Provide a test plan demonstrating that the code is solid.
[ ] Match the code formatting of the rest of the codebase.
[ ] Target the master branch, NOT a "stable" branch.

Motivation (required)
What existing problem does the pull request solve?
Test Plan (required)
A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See What is a Test Plan? to learn more.
If you have added code that should be tested, add tests.
Next Steps
Sign the CLA, if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all tests pass on both Travis and Circle CI. PRs that break tests are unlikely to be merged.
For more info, see the "Pull Requests" section of our "Contributing" guidelines.

Great points! All fixed now!

I see a few extra things, but difficult to comment as I'm on the bus. One point is that you need to map event names on Android (see my example project). I'll provide better examples when I get home.

Nice! This looks good to me. Do you want to PR it over to my branch, to make it a part of the official repo PR?
Again, awesome work on the docs. I really appreciate all the help and feedback!


Decrease the minimum support version and add support for PHP 8.2

Hello,
I would like to propose to decrease the minimum supported version of the package.
The current version 8.1 doesn't agree with the PHP version of the main package.
PS: Same PR adds support for PHP 8.2 (there is nothing to update inside except github workflow :) ).

Thanks!


add replicatedhq/troubleshoot binary build

Issue #, if available:
Description of changes:
add build infrastructure for publishing replicatedhq/troulbeshoot binaries for inclusion in the MR_TOOLS image
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

/retest


upgrade com.sendgrid.sendgrid-java 2.2.2=>3.0.0

SendGrid 3.0.0 Upgrade
V3 API Reference:
https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html
V3 Java Client and API Usage Example:
https://github.com/sendgrid/sendgrid-java#quick-start

lgtm


Peer list maintenance

Need to establish connections to a bunch of peers and maintain health in the peer list.
I'm not fully sure what the current algorithm is, but a good algorithm for the beta is to probably connect to a bunch of hardcoded peers, followed by asking for more peers, and then setting a timer that every 2-5 minutes asks for more peers.
It's pretty easy to sybil attack peers, so we'll want something that's robust to that. I don't have a ton of ideas at the moment, but perhaps when requesting peers,  uhhh, they get batched based on who told you about them?
I'm struggling to think of something that would be easily exploitable. Perhaps Bitcoin has better solutions, but iirc finding peers and not getting DDOS'd is a very hard problem and potentially the weakest link in the Bitcoin protocol.

update?

determined as "good enough" by some pr in the past


Package is not available on pypi

I want to publish a package on pypi that depends on pydot.
As you're aware, the pypi package is unmaintained an out-of-date.
I briefly had my own fork and contacted the maintainer. He seemed willing to pass on ownership of the palckage, but the conversation never went beyond that.
IMO uploading the package under a different name (even pydot2) would be a good way forward.

I think that such PyPI entries already exist:

pydot-ng
pydotplus.

I believe that preserving the name is important, in order to avoid unnecessary renames in code, over many packages.
The original googlecode page of pydot has been updated to forward to the [original author's repository on github(https://github.com/erocarrera/pydot). So, an "official" repository exists on github. The next thing would be to:

merge the changes collected here to upstream.
find a maintainer for the PyPI entry.

I would be happy to do both, as I have had the same issue with pydot being an exception for pip. You mention that the PyPI owner appears willing to add a maintainer. So, there was just no further action in that direction ?

Yep, I agree with all of that.
I was in contact with Ero Carrera over email about adding a maintainer, he seemed happy with it, I followed up to ask about the next steps and he didn't get back to me. Definitely worth trying again. I can reach out again if you want - or leave it to you. This was about 18 months ago IIRC.

+1 for someone taking over the existing PyPI entry and merging these Python 3 fixes.

Yes, it would definitely be good to try to consolidate the different pydot forks and update the package on PyPI.
Pinging @ksambor and @prmtl of pydot-ng, @carlos-jenkins of pydot-plus, and @ajsteven130, whose fork has recent work.

Hello,
For my fork, I just went through and cleared all the errors to get pydot to install on Python 3.4. It installs and works fine, but I am not sure it should be counted on as an official package. I'd be very happy if the small of work there is useful and could be integrated into a better maintained repository.
If there is any way I can help, let me know

The (original) author of pydot does have a PyPI entry for Python 3 called pydot3k. Note that it installs as pydot, so changes needed in source code. This enables conditional dependency selection, until the pydot entry is updated.

Our fork (pydot-ng) was created because we needed the work from https://github.com/nlhepler/pydot and a package on PyPI (with support for Python 2.6). There are no much changes from original fork, mostly cleaning code/

Just a reminder, it would be great if someone could work out which of the various forks is the best starting point, contact Ero to get the name on PyPI and upload a new release. I just helped another person on StackOverflow who was trying to use the original 'pydot' package on Python 3.

I emailed @erocarrera (last week) about maintenance of pydot and its PyPI entry. I received no reply, thus I will evaluate the other packages (non-pydot) and switch to a maintained one.
The collection of pydot forks have various names and fixes, but are isolated side-projects that tend to become unmaintained projects too. For example, pydotplus is restructured (from a module to a package with a non-standard directory tree), and doesn't define any pydotplus.__version__ (__version__ was originally defined inside the standalone module pydot.py), but in pydotplus.version.
PEP 8 is not followed, and top-down parsing (pyparsing) doesn't scale to what bottom-up parsing can do (lex-yacc, i.e., ply and other parser generators). This seems to suggest using a newer and maintained package, for example graphviz (even if it doesn't have a parser, after all serves mostly as a backend).
For posterity, https://github.com/carlos-jenkins/pydotplus/issues/1.

Hey all,
I think moving to a maintained version of pydot is definitely the way to go. I modified this package to assist me in my graduate studies, but I'm afraid I don't have the bandwidth to maintain it. pydot-ng seems to be the way to go.
TL;DR: I don't have the bandwidth to maintain this package, please look at forks, including pydot-ng and pydotplus.

@erocarrera has added me as a maintainer for pydot (on GitHub and PyPI), so we can start updating the master branch, and make a release. I think that this addresses the OP.

Excellent, thanks @johnyf

pydot is being maintained, and the latest version available on PyPI. I would suggest closing this issue.


Support using badger as LogDB

https://github.com/dgraph-io/badger has already been used heavily in dgraph.

duplicate with https://github.com/lni/dragonboat/issues/18, sorry.


Reverting user-agent change that came with rename.

Fixes #2271.
See https://github.com/GoogleCloudPlatform/gcloud-common/issues/179 for context.
Also moving gRPC user-agent from plugin to channel options. For context on that change, see the comment by @murgatroid99: https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1568/files#r77727186
As for grpc.primary_user_agent vs grpc.secondary_user_agent, @nathanielmanistaatgoogle said

That way the user agent as it appears on the wire should be "primarily gRPC, secondarily gcloud" rather than "primarily gcloud ".

LGTM.  The primary / secondary bit doesn't really make sense, but if it is what the back-end team wants, I can acquiesce.

Added the "don't merge" label. I'll hold off until @nathanielmanistaatgoogle or @murgatroid99 can weigh in.

Luhguhtum, but I'd also appreciate hearing from @murgatroid99.

I don't actually know what the primary vs secondary user agents are supposed to be, semantically. Node appends its own user agent string to the provided primary user agent string, so I just assumed that the calling library was expected to provide its own primary user agent string.

I'm going to merge then since the consensus from the two gRPC maintainers is like 75% of a thumbs up: "do it" and "not sure"
I'd say this should probably be documented somewhere though?

@dhermes: Aww, phooey, I just had a conversation on your behalf with @ctiller.
A few takeaways:

If an application attempts to set user-agent as though it were an ordinary piece of metadata, the core will eat the supplied value and not put it on the wire, so using (a) channel argument(s) is the only way to alter the user-agent sent to the server along with your RPCs. So the whole conversation we had the other day about which means was preferred apparently could have been resolved by the knowledge that only one means is effective.
Culturally, the "most important" or "most specific" information in the user-agent string goes first, so I erred in guiding you to pass your application information as a secondary, rather than primary, user agent channel arg. My apologies; today I learned.

I've filed grpc.github.io issue 380 to track improving our documentation for user-agent application best practices.

It's an easy fix, I'll send the PR to fix post-haste. Thanks for looking into it.


Only register an offense for StringReplacement if the length of the pattern is 1

This fixes #2061.

Btw, I'm guessing we should still point that gsub(/ala/, something) is the same as gsub('ala', something) and probably the second version is more efficient (and it's easier to read).

Btw, I'm guessing we should still point that gsub(/ala/, something) is the same as gsub('ala', something) and probably the second version is more efficient (and it's easier to read).

I agree that a string is more readable than regex. As for performance, regex is faster until Ruby 2.1 or 2.2. We could use a similar method to identify what can be changed. Recommending string vs regex feels like different functionality than gsub to tr or delete. I can write a separate cop to handle string vs regex passed to gsub. Should that cop be dependent on Ruby version to recommend regex vs string, or always recommend string?

Should that cop be dependent on Ruby version to recommend regex vs string, or always recommend string?

It should always recommend string. We should compile a list of eligible methods to check in it (apart from sub & friends).

A quick search of [Ruby Docs}(http://ruby-doc.org/core-2.2.0/String.html), points to sub, gsub, index, partition, rindex, rpartition, scan, and split all allowing string to regex.
match also allows string or regex, but will convert the string to regex. Should we recommend string here as well or regex since that is the natural form?

match also allows string or regex, but will convert the string to regex. Should we recommend string here as well or regex since that is the natural form?

Guess using regexp would be better for match.


Prevent race conditions on postgres

Tested with 50 simultaneous connections. This 100% guarantees correctness of the sequential_id in Postgres and makes no change to the previous behavior for other database adapters.
Unfortunately this is not so trivial to implement in MySQL because table locks must be manually released.

Here is the test code:
THREADS = 50
def test
  SequentialTest.destroy_all
  initial = 0

  threads = (1..THREADS).map do |i|
    Thread.new do
      ActiveRecord::Base.connection_pool.with_connection do
        SequentialTest.create!(scope_id: 42)
      end
    end
  end

  threads.each {|t| t.join}

  final = SequentialTest.pluck('max(sequential_id)')[0]

  fail('not concurrent-safe') unless final == initial + THREADS
end

@djreimer I enabled postgresql for your test suite and wrote a test case. It fails without the locking, and succeeds with locking enabled.

Rock on! :metal: This is great. I want to run some tests on my local machine, but looks like you've covered all the bases. This should be merged soon. Thanks!

@djreimer Hey man. Let me know if there's anything you need from me or comments you have on the code that I can fix :+1:

Cool will do. This is in on my todo list for a lazy post-Thanksgiving Friday
On Friday, November 27, 2015, Sam Philip<EMAIL_ADDRESS>wrote:

@djreimer https://github.com/djreimer Hey man. Let me know if there's
anything you need from me or comments you have on the code that I can fix [image:
:+1:]
—
Reply to this email directly or view it on GitHub
https://github.com/djreimer/sequenced/pull/16#issuecomment-160203752.

--
Derrick

This was one of my concerns, and I'm glad see that it was taken care! Thanks @samphilipd !


Issue#77 documentatie

Story Title
Issue#77 documentatie
Changes made

New tutorials for both logistic and linear regression (move from html to ipynb)
Updated modules
updated readme with updated links to module overview and tutorials
generated html's that can be coppied to cobra.io

How does the solution address the problem
update of documentation for newest release
Linked issues
Resolves #77

Again a little mistake. I'll close this one and reopen once I reviewed the pull request of Sam (https://github.com/PythonPredictions/cobra/pull/102)


Support AMD modules in Salsa

From @justin-romano on February 3, 2016 21:56
It just does nothing unless its a local variable.
I would have suspected this would present a list of all possible matching items in the source.
Its almost as if its not even indexing the code. I am working in a source base of millions of lines of JS so it would be nice.
Products like resharper and visual assist do this better.
Copied from original issue: Microsoft/vscode#2683

@justin-romano Then I assume your code isn't using the commonjs module system? Are you using another JS module system?

Please give Salsa our new JS infrastructure a try. Here is how:
get the insider channel: https://blogs.msdn.microsoft.com/vscode/2016/02/01/introducing-insiders-builds/
enable salsa: https://github.com/Microsoft/vscode-docs/blob/master/release-notes/latest.md#javascript---salsa-preview

From @dresoy on February 4, 2016 1:17
I agree, it should search it for JavaScript.

From @justin-romano on February 5, 2016 20:53
Thanks egamma but i could not see it make a difference. Is there some think like lucene indexing the code when you load a folder?
It does not seem very busy when it starts and noticed that the search is really slow which implies its just trawling the files rather then indexing the source.

Thanks, got it. Salsa doesn't support AMD yet. I'll move it as a feature request to Salsa component.

From @justin-romano on February 6, 2016 16:50
No actually anguar and requirejs.
On Sun, Feb 7, 2016 at 4:52 AM, Erich Gamma<EMAIL_ADDRESS>wrote:

@justin-romano https://github.com/justin-romano Then I assume your code
isn't using the commonjs module system? Are you using another JS module
system?
—
Reply to this email directly or view it on GitHub
https://github.com/Microsoft/vscode/issues/2683#issuecomment-180796779.

--
Justin Romaine
Senior Systems Architect
Spark Dental Technology
<EMAIL_ADDRESS>ph 021 764 506
hm 09 445 9166

When we looked into this, AMD seemed to be fairly complicated to get right statically, at least compared to CommonJS modules.

@egamma can you weigh in on the priority of AMD module support? given that ES6 is now ubiquitous, as well as other bundling technologies like browserify and webpack that use CommonJS.

Why dont you just have a grab everything from everywhere mode. So you don't
need a dependency change. Just scan the folders.
Goto definition then should just give you a choice rather that you can
scroll based on most likely candidates. Also remembers your previous
choices and places them at the top of the list. kind of like the ctrl+P
works
On Sun, Feb 7, 2016 at 9:57 AM, Mohamed Hegazy<EMAIL_ADDRESS>wrote:

@egamma https://github.com/egamma can you weigh in on the priority of
AMD module support? given that ES6 is now ubiquitous, as well as other
bundling technologies like browserify and webpack that use CommonJS.
—
Reply to this email directly or view it on GitHub
https://github.com/Microsoft/TypeScript/issues/6942#issuecomment-180863287
.

--
Justin Romaine
Senior Systems Architect
Spark Dental Technology
<EMAIL_ADDRESS>ph 021 764 506
hm 09 445 9166

given that ES6 is now ubiquitous, as well as other bundling technologies like browserify and webpack that use CommonJS.

@mhegazy I fully agree that this is correct for more recent JS code bases, but there are also code bases with more mileage. I'll try to find out whether there is some data on this.

given that ES6 is now ubiquitous

Syntax yes, but there is yet to be any real loader or agreement on module resolution! :smile: Which is largely what is holding a lot of things back in my opinion.
There are significant issues with CommonJS in the browser, which is exactly why AMD came about to deal with those challenges (and had to split from CommonJS because there couldn't be agreement), to allow asynchronous lazy loading, two pass instantiation, etc. etc. and those advantages and AMD builders like r.js are heavily used by many real life projects in lieu alternatives like Browserify and WebPack.  In face, though popularity contests aren't always an indicator, RequireJS out strips Browserify and WebPack and only recently has WebPack overtaken RequireJS.
I do agree though, static analysis is challenging for AMD modules, as there are several valid scenarios and because AMD by its nature is two pass instantiation, with circular references and potentially complex configuration information being available to the loader that makes mapping of the MID to the actual file challenging, it wouldn't be a trivial task to accomplish.

The lack of AMD support makes me unable to use VSCode, unfortunately.  I don't really want to use IntelliJ, but it's able to do analysis of my code far more trivially than VSCode is able to...

I'd like to add that AMD support would be super helpful in VSCode.
I'm a Netsuite developer, and it uses AMD syntax. It makes it harder when I can't easily click a definition and go to it when other IDEs like WebStorm can. Instead, I have to do a search all manually.

I would definitely love to have to this feature. I think there are several legacy codebases out there which would benefit from this feature.

If you are looking for the support of AMD/CJS JavaScript modules for the "Go to Definition" command (custom definition provider), you can have a look at the VS Code extension "Require Module Support":

https://marketplace.visualstudio.com/items?itemName=lici.require-js
https://github.com/anacierdem/vscode-requirejs

It supports RequireJS configuration (paths) to look up and jump to the original location of the selected identifier's definition.

I'm closing this since the JS ecosystem has largely moved on writing AMD. This is not an area we plan to invest engineering effort in supporting


JSON RPC interface with go-ethereum

In GitLab by @fahree on Mar 10, 2020, 22:35
Create a JSON RPC interface to go-ethereum in Gerbil Scheme.
One way to do it would be to port what I wrote in our previous OCaml runtime at:

ethereum_json_rpc.ml and .mli
json_rpc.ml and .mli
yojsoning.ml and .mli

In GitLab by @fahree on Mar 10, 2020, 22:45
changed the description

In GitLab by @fahree on Mar 11, 2020, 01:18
assigned to @oudeis

In GitLab by @fahree on Mar 11, 2020, 01:19
@oudeis can you start with the equivalent of json_rpc ? I'll work on the equivalent of yojsoning, and then you can do the equivalent of ethereum_json_rpc.

In GitLab by @fahree on Nov 7, 2020, 02:48
changed the description


Forward-merge release-0.17 into master

@fabxc I think this is what we want.

:+1:

CI errors are in master already, have to be fixed separately.

Why was the changelog merged into master, describing 0.17.0 as being release with a release date in the past?

For context: This PR simply merges forward into master what was done in the 0.17 release branch. It has no opinion about its correctness. If you want to change something that should affect 0.17, please change it there (will be merged forward later). If you want to change something that should only affect 0.18 and later, do it in master. Commenting on this PR about things already committed to the 0.17 release branch are out of place.
Thank you.


Conflicting security advice

In 2016, Microsoft released this whitepaper: https://www.microsoft.com/en-us/research/publication/password-guidance/
in which the position given is "Password expiration policies do more harm than good".
Microsoft also provides this recommendation guide for Office 365:
https://support.office.com/en-us/article/Password-policy-recommendations-for-Office-365-9fa2539a-2211-41fd-85a0-bc37b9619ca4
Which provides the recommendation: Don't require mandatory periodic password resets for user accounts
These two peices of advise are consistent with advice from UK's NCSC: https://www.ncsc.gov.uk/articles/problems-forcing-regular-password-expiry
And the new NIST guidelines.
However, this document, under the section "threat protection" describes non-expiring passwords as a "major security risk". The countermeasure proposed contradicts previously quoted Microsoft advise.
Although I've logged this under "Windows 10", an identical setting exists under Windows Server 2016 Group Policy.

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

ID: ed5f0d1b-bfbb-c2a8-76e7-b4b0105160e8
Version Independent ID: 13684860-a76b-5832-4376-22a585f63fd1
Content: Maximum password age (Windows 10)
Content Source: windows/security/threat-protection/security-policy-settings/maximum-password-age.md
Service: unspecified
GitHub Login: @brianlic-msft
Microsoft Alias: justinha

@technion Thanks for opening this issue. Other readers have also commented about this research. I've reached out to the author of the whitepaper to help reconcile the guidance. In the meantime, we can add a link to the whitepaper along with other additions you proposed. But I don't want to remove the existing guidance in this topic before our engineering team has the chance to reconcile it with the whitepaper. I'll submit a pull request to our private repo that includes your commit.

@Justinha  Thanks for this response.
I just want to note it's not one Microsoft whitepaper with a contradicting view. You can see a listing of references here:
https://gist.github.com/technion/65c652194fb1427e6828ea23ff46d280


Does not handle OperationTypes

It looks like this library doesn't support having operation names as part of the query. For example, this works:
{
    hero {
        name
    }
}

while this does not:
query {
    hero {
        name
    }
}

Both should be valid according to the spec.

I looked into this a little more and it looks like the lexer works fine; the problem is in the parser.

fixed in version 0.7.1, already on PyPI. The problem was caused by the lack of support for anonymous queries. Thank you for flagging this!


local vs global attention in further MLM pre-training.

I am currently looking into the conversion script to create a longformer from an already pre-trained Roberta implementation. I noticed that the script further pre-trains the Longformer on MLM with only local attention.

What exactly is the motive behind not having tokens (e.g. bos and eos) attend globally as well?
Would it make sense to alter this if the goal you have in mind is focussed on tasks that require embeddings of the entire sequence? (e.g. unsupervised document similarity)

I think the tokenizer used in Roberta caused it. There is no global attention mask in the outputs of Bert/Roberta tokenizer.

I have also the same question. It's not clear how they use global attention during Longformer pre-training.

I have also the same question. It's not clear how they use global attention during Longformer pre-training.

so do i when i read a paper about MDS, i find it may not use global attention.


出个微iPad协议/源码，代部署。比wechaty功能多，比wechaty性能稳定，无限号无限时永久免费调用。

联系方式微信：AIYLWL

I would love to hear from the community for feedback about how this code works.

联系方式微信：AIYLWL

AIYLWL，这个微信号添加显示用户不存在

再试试

再试试看

联系方式微信：AIYLWL

AIYLWL，这个微信号添加显示用户不存在

再试试看

Close this issue because it's unrelated to Wechaty Puppet Support.
However, if you want to create an Wechaty Puppet for your implementation, you are welcome to go ahead, and I'd like to know more about your plan on our Discord Server: https://discord.gg/7q8NBZbQzt


Invalid flutter command in Readme.md

The Readme contains following instructions for building Leaflet:

For now the required flutter channel is master, so issue those two commands before starting building:
~$ flutter channel master
~$ flutter update

When trying to run the second one, I get following output:
$ flutter update
Could not find a command named "update".

Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.

Do you mean to run flutter upgrade?

Oops yea, seems like i got it wrong, the correct command is upgrade indeed

Ok, I'll open a PR to fix it :)


Default org values

Notion card
Summary
Loom
Preview

Type of change
Please delete options that are not relevant.

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to
not work as expected)
[ ] This change requires a documentation update

How Has This Been Tested?

Checklist:

[x] I have manually tested all workflows
[x] I have performed a self-review of my own code
[ ] I have added automated tests for my code

@Abinash393 please rebase

Updated Loom Video

@supriya3105 On selecting a country we can only see the timezones of that selected country only. Is that okay?

@abinashpa merging this for now. please raise separate PR to make eastern central time as default timezone when country selected is US.


(PRODEV-10186) - Customize the trivy-action to pre-pull the vulnerability DB

It's all in the title.

 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.You have signed the CLA already but the status is still pending? Let us recheck it.


Issue when Mock is an attribute of the test suite

Hi, we wanted to start using your library to mock Kotlin classes in Spock, but we have seen an issue when the Mock is declared as attribute of the Specification as in that case it fails to use the transformed class without finals. This is reproducible when using Maven and I see it doesn't reproduce when using Gradle, I created a demo project from the examples using Maven here: https://github.com/raycoarana/maven-mockable-kotlin.
I have been debugging the issue and the classes seems to be changed with byte-buddy, so don't know why it is not being used then.

@raycoarana Let me take a closer look

@raycoarana I can not reproduce the error. The maven setup was missing some versions and a slf dependency but otherwise it is building just fine. I forked your project made a few pom additions and added github build workflow asdf. The maven verify is passing:
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ kotlin-example ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[main] INFO io.github.joke.spockmockable.internal.MockableExtension - Activating @Mockable transformation
[INFO] Running CompanyTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.488 s - in CompanyTest
[INFO] Running PersonTestWithMockablePackage
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.036 s - in PersonTestWithMockablePackage
[INFO] Running PersonTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in PersonTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ kotlin-example ---
[INFO] Building jar: /home/runner/work/maven-mockable-kotlin/maven-mockable-kotlin/target/kotlin-example-1.0.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Can you be more specific about your maven, jdk setup?

Hi @joke, thx for the response. Let me try to find a way to let you reproduce it. I have it reproduced in both Mac M1 with OpenJDK 17 and Ubuntu 20 x86_64 with Oracle JDK 17.0.3. Both with Maven 3.8.5.
Let me try to see if I can reproduce it with GH Actions.

@raycoarana Could you add the slf4j dependency. Maybe there is some error log which is not printed.

@raycoarana I tried running locally everything with both JDKs. Seems to be working as well.
maven-mockable-kotlin on  main is 📦 v1.0.0-SNAPSHOT via ☕ v17.0.3
❯ java --version
openjdk 17.0.3 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)

maven-mockable-kotlin on  main is 📦 v1.0.0-SNAPSHOT via ☕ v17.0.3
❯ ./mvnw clean verify
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.github.:kotlin-example >---------------------
[INFO] Building kotlin-example 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ kotlin-example ---
[INFO] Deleting /home/joke/Projects/joke/maven-mockable-kotlin/target
[INFO]
[INFO] --- gmavenplus-plugin:1.13.1:addTestSources (add-test-source) @ kotlin-example ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ kotlin-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/joke/Projects/joke/maven-mockable-kotlin/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ kotlin-example ---
[INFO] No sources to compile
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.20:compile (compile) @ kotlin-example ---
[WARNING] Using experimental Kotlin incremental compilation
[INFO] Non-incremental compilation will be performed: NO_BUILD_HISTORY
[INFO] Kotlin compile iteration: /home/joke/Projects/joke/maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Address.kt, /home/joke/Projects/joke/maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Company.kt, /home/joke/Projects/joke/maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Person.kt
[INFO] Exit code: OK
[INFO] Compiled 3 Kotlin files using incremental compiler
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ kotlin-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/joke/Projects/joke/maven-mockable-kotlin/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ kotlin-example ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.20:test-compile (test-compile) @ kotlin-example ---
[WARNING] No sources found skipping Kotlin compile
[INFO]
[INFO] --- gmavenplus-plugin:1.13.1:compileTests (default) @ kotlin-example ---
[INFO] Using isolated classloader, without GMavenPlus classpath.
[INFO] Using Groovy 3.0.9 to perform compileTests.
[INFO] Parallel parsing disabled.
[INFO] Compiled 5 files.
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ kotlin-example ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[main] INFO io.github.joke.spockmockable.internal.MockableExtension - Activating @Mockable transformation
[INFO] Running CompanyTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.122 s - in CompanyTest
[INFO] Running PersonTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 s - in PersonTest
[INFO] Running PersonTestWithMockablePackage
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in PersonTestWithMockablePackage
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ kotlin-example ---
[INFO] Building jar: /home/joke/Projects/joke/maven-mockable-kotlin/target/kotlin-example-1.0.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.041 s
[INFO] Finished at: 2022-06-04T13:28:57+02:00
[INFO] ------------------------------------------------------------------------

maven-mockable-kotlin on  main is 📦 v1.0.0-SNAPSHOT via ☕ v17.0.3
❯ java --version
java 17.0.3 2022-04-19 LTS
Java(TM) SE Runtime Environment (build 17.0.3+8-LTS-111)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.3+8-LTS-111, mixed mode, sharing)

maven-mockable-kotlin on  main is 📦 v1.0.0-SNAPSHOT via ☕ v17.0.3
❯ ./mvnw clean verify
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.github.:kotlin-example >---------------------
[INFO] Building kotlin-example 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ kotlin-example ---
[INFO] Deleting /home/joke/Projects/joke/maven-mockable-kotlin/target
[INFO]
[INFO] --- gmavenplus-plugin:1.13.1:addTestSources (add-test-source) @ kotlin-example ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ kotlin-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/joke/Projects/joke/maven-mockable-kotlin/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ kotlin-example ---
[INFO] No sources to compile
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.20:compile (compile) @ kotlin-example ---
[WARNING] Using experimental Kotlin incremental compilation
[INFO] Non-incremental compilation will be performed: NO_BUILD_HISTORY
[INFO] Kotlin compile iteration: /home/joke/Projects/joke/maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Address.kt, /home/joke/Projects/joke/maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Company.kt, /home/joke/Projects/joke/maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Person.kt
[INFO] Exit code: OK
[INFO] Compiled 3 Kotlin files using incremental compiler
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ kotlin-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/joke/Projects/joke/maven-mockable-kotlin/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ kotlin-example ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.20:test-compile (test-compile) @ kotlin-example ---
[WARNING] No sources found skipping Kotlin compile
[INFO]
[INFO] --- gmavenplus-plugin:1.13.1:compileTests (default) @ kotlin-example ---
[INFO] Using isolated classloader, without GMavenPlus classpath.
[INFO] Using Groovy 3.0.9 to perform compileTests.
[INFO] Parallel parsing disabled.
[INFO] Compiled 5 files.
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ kotlin-example ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[main] INFO io.github.joke.spockmockable.internal.MockableExtension - Activating @Mockable transformation
[INFO] Running CompanyTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.13 s - in CompanyTest
[INFO] Running PersonTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.018 s - in PersonTest
[INFO] Running PersonTestWithMockablePackage
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in PersonTestWithMockablePackage
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ kotlin-example ---
[INFO] Building jar: /home/joke/Projects/joke/maven-mockable-kotlin/target/kotlin-example-1.0.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.913 s
[INFO] Finished at: 2022-06-04T13:31:03+02:00
[INFO] ------------------------------------------------------------------------

Yep, added that but nothing else is printed, just the error where the Mock is created.
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.github.:kotlin-example >---------------------
[INFO] Building kotlin-example 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ kotlin-example ---
[INFO] Deleting /home/rayco/projects/maven-mockable-kotlin/target
[INFO]
[INFO] --- gmavenplus-plugin:1.13.1:addTestSources (add-test-source) @ kotlin-example ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ kotlin-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/rayco/projects/maven-mockable-kotlin/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ kotlin-example ---
[INFO] No sources to compile
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.20:compile (compile) @ kotlin-example ---
[WARNING] Using experimental Kotlin incremental compilation
[INFO] Non-incremental compilation will be performed: NO_BUILD_HISTORY
[INFO] Kotlin compile iteration: /home/rayco/projects/maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Address.kt, /home/rayco/projects/maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Company.kt, /home/rayco/projects/maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Person.kt
[INFO] Exit code: OK
[INFO] Compiled 3 Kotlin files using incremental compiler
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ kotlin-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/rayco/projects/maven-mockable-kotlin/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ kotlin-example ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.20:test-compile (test-compile) @ kotlin-example ---
[WARNING] No sources found skipping Kotlin compile
[INFO]
[INFO] --- gmavenplus-plugin:1.13.1:compileTests (default) @ kotlin-example ---
[INFO] Using isolated classloader, without GMavenPlus classpath.
[INFO] Using Groovy 3.0.9 to perform compileTests.
[INFO] Parallel parsing disabled.
[INFO] Compiled 5 files.
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ kotlin-example ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running PersonTest
[ERROR] Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.028 s <<< FAILURE! - in PersonTest
[ERROR] final from class is removed  Time elapsed: 0.004 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
	at io.github.joke.spockmockable.tests.PersonTest.$spock_initializeFields(PersonTest.groovy:10)

[ERROR] final from method is removed  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
	at io.github.joke.spockmockable.tests.PersonTest.$spock_initializeFields(PersonTest.groovy:10)

[ERROR] private on method is now protected  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
	at io.github.joke.spockmockable.tests.PersonTest.$spock_initializeFields(PersonTest.groovy:10)

[ERROR] final is removed and private on method is now protected  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
	at io.github.joke.spockmockable.tests.PersonTest.$spock_initializeFields(PersonTest.groovy:10)

[INFO] Running PersonTestWithMockablePackage
[ERROR] Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.14 s <<< FAILURE! - in PersonTestWithMockablePackage
[ERROR] final from class is removed  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
	at io.github.joke.spockmockable.tests.PersonTestWithMockablePackage.$spock_initializeFields(PersonTestWithMockablePackage.groovy:11)

[ERROR] final from method is removed  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
	at io.github.joke.spockmockable.tests.PersonTestWithMockablePackage.$spock_initializeFields(PersonTestWithMockablePackage.groovy:11)

[ERROR] private on method is now protected  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
	at io.github.joke.spockmockable.tests.PersonTestWithMockablePackage.$spock_initializeFields(PersonTestWithMockablePackage.groovy:11)

[ERROR] final is removed and private on method is now protected  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
	at io.github.joke.spockmockable.tests.PersonTestWithMockablePackage.$spock_initializeFields(PersonTestWithMockablePackage.groovy:11)

[INFO] Running CompanyTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.189 s - in CompanyTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   PersonTest.$spock_initializeFields:10->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTest.$spock_initializeFields:10->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTest.$spock_initializeFields:10->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTest.$spock_initializeFields:10->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTestWithMockablePackage.$spock_initializeFields:11->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTestWithMockablePackage.$spock_initializeFields:11->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTestWithMockablePackage.$spock_initializeFields:11->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTestWithMockablePackage.$spock_initializeFields:11->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[INFO]
[ERROR] Tests run: 10, Failures: 0, Errors: 8, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.134 s
[INFO] Finished at: 2022-06-04T13:38:21+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project kotlin-example: There are test failures.
[ERROR]
[ERROR] Please refer to /home/rayco/projects/maven-mockable-kotlin/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@raycoarana The Activating @Mockable transformation line is missing. Can you check whether the file target/test-classes/META-INF/spock-mockable.properties has been created? It should look like this:
#Automatically generated by spock-mockable
#Sat Jun 04 13:31:01 CEST 2022
classes=io.github.joke.spockmockable.tests.Company,io.github.joke.spockmockable.tests.Person,io.github.joke.spockmockable.tests.Address
packages=io.github.joke.spockmockable.tests

Oh, that must be because I just redirect the output to a file, but that line is printed when executing tests, yep. That file is created with the same content, all classes and the package-name. Also I have check debbuging that all that code is executed, detect the classes, write the file, read them and sent to byte-budy to transform, so that seems to work properly.
It is when executing the test when Spock when fails, it is like the class it is using is not the transformed one, maybe it has read it before the transformation? I don't know if there is some concurrency there and in fast enough systems, Spock load that classes before the transformation is done, but this is just speculating actually :-D.

I have added trace level to logger, to see all that is happening, you can see it here=> https://github.com/raycoarana/maven-mockable-kotlin/blob/main/result.txt

The properties file is read rather early. Transformation is done by byte buddy instrumentation as soon as classes are loaded the very first time in the JVM. This does not happen on a per test basis actually. If you are not doing funny stuff with the class loading opening the classes should work.

Regarding the tracing output everything seems correctly. Do you start he maven or JVM in a non default way?
Since the transformation in done by JVM instrumentation during class loading there shouldn't be any problems regarding concurrency.

Nope, I don't execute it when anything special, just mvnw clean verify. Also check with JDK 17.0.3 tem (installed using SDK man), but nothing changes.

Could you try building the repository I forked. I installed my JVM using https://asdf-vm.com/ But that should not make any difference.

 ✘  rayco  ~/projects  gh repo clone joke/maven-mockable-kotlin joke-maven-mockable-kotlin
Cloning into 'joke-maven-mockable-kotlin'...
remote: Enumerating objects: 142, done.
remote: Counting objects: 100% (142/142), done.
remote: Compressing objects: 100% (64/64), done.
remote: Total 142 (delta 28), reused 142 (delta 28), pack-reused 0
Receiving objects: 100% (142/142), 93.48 KiB | 528.00 KiB/s, done.
Resolving deltas: 100% (28/28), done.
Updating upstream
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 19 (delta 5), reused 17 (delta 3), pack-reused 0
Unpacking objects: 100% (19/19), 100.45 KiB | 598.00 KiB/s, done.
From github.com:raycoarana/maven-mockable-kotlin
 * [new branch]      main       -> upstream/main
 rayco  ~/projects  cd joke-maven-mockable-kotlin
 rayco  ~/projects/joke-maven-mockable-kotlin   main  ./mvnw clean verify
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.github.:kotlin-example >---------------------
[INFO] Building kotlin-example 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ kotlin-example ---
[INFO]
[INFO] --- gmavenplus-plugin:1.13.1:addTestSources (add-test-source) @ kotlin-example ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ kotlin-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/rayco/projects/joke-maven-mockable-kotlin/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ kotlin-example ---
[INFO] No sources to compile
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.20:compile (compile) @ kotlin-example ---
[WARNING] Using experimental Kotlin incremental compilation
[INFO] Non-incremental compilation will be performed: NO_BUILD_HISTORY
[INFO] Kotlin compile iteration: /home/rayco/projects/joke-maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Address.kt, /home/rayco/projects/joke-maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Company.kt, /home/rayco/projects/joke-maven-mockable-kotlin/src/main/kotlin/io/github/joke/spockmockable/tests/Person.kt
[INFO] Exit code: OK
[INFO] Compiled 3 Kotlin files using incremental compiler
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ kotlin-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/rayco/projects/joke-maven-mockable-kotlin/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ kotlin-example ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.20:test-compile (test-compile) @ kotlin-example ---
[WARNING] No sources found skipping Kotlin compile
[INFO]
[INFO] --- gmavenplus-plugin:1.13.1:compileTests (default) @ kotlin-example ---
[INFO] Using isolated classloader, without GMavenPlus classpath.
[INFO] Using Groovy 3.0.9 to perform compileTests.
[INFO] Parallel parsing disabled.
[INFO] Compiled 5 files.
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ kotlin-example ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[main] INFO io.github.joke.spockmockable.internal.MockableExtension - Activating @Mockable transformation
[INFO] Running PersonTest
[ERROR] Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.026 s <<< FAILURE! - in PersonTest
[ERROR] final from class is removed  Time elapsed: 0.003 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
        at io.github.joke.spockmockable.tests.PersonTest.$spock_initializeFields(PersonTest.groovy:10)

[ERROR] final from method is removed  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
        at io.github.joke.spockmockable.tests.PersonTest.$spock_initializeFields(PersonTest.groovy:10)

[ERROR] private on method is now protected  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
        at io.github.joke.spockmockable.tests.PersonTest.$spock_initializeFields(PersonTest.groovy:10)

[ERROR] final is removed and private on method is now protected  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
        at io.github.joke.spockmockable.tests.PersonTest.$spock_initializeFields(PersonTest.groovy:10)

[INFO] Running PersonTestWithMockablePackage
[ERROR] Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.145 s <<< FAILURE! - in PersonTestWithMockablePackage
[ERROR] final from class is removed  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
        at io.github.joke.spockmockable.tests.PersonTestWithMockablePackage.$spock_initializeFields(PersonTestWithMockablePackage.groovy:11)

[ERROR] final from method is removed  Time elapsed: 0.001 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
        at io.github.joke.spockmockable.tests.PersonTestWithMockablePackage.$spock_initializeFields(PersonTestWithMockablePackage.groovy:11)

[ERROR] private on method is now protected  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
        at io.github.joke.spockmockable.tests.PersonTestWithMockablePackage.$spock_initializeFields(PersonTestWithMockablePackage.groovy:11)

[ERROR] final is removed and private on method is now protected  Time elapsed: 0 s  <<< ERROR!
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class io.github.joke.spockmockable.tests.Person  because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.
        at io.github.joke.spockmockable.tests.PersonTestWithMockablePackage.$spock_initializeFields(PersonTestWithMockablePackage.groovy:11)

[INFO] Running CompanyTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.192 s - in CompanyTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   PersonTest.$spock_initializeFields:10->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTest.$spock_initializeFields:10->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTest.$spock_initializeFields:10->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTest.$spock_initializeFields:10->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTestWithMockablePackage.$spock_initializeFields:11->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTestWithMockablePackage.$spock_initializeFields:11->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTestWithMockablePackage.$spock_initializeFields:11->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[ERROR]   PersonTestWithMockablePackage.$spock_initializeFields:11->SpecInternals.MockImpl:85->SpecInternals.createMockImpl:292->SpecInternals.createMockImpl:302->SpecInternals.createMock:47 » CannotCreateMock
[INFO]
[ERROR] Tests run: 10, Failures: 0, Errors: 8, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.143 s
[INFO] Finished at: 2022-06-04T14:17:31+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project kotlin-example: There are test failures.
[ERROR]
[ERROR] Please refer to /home/rayco/projects/joke-maven-mockable-kotlin/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Running in a matrix when several combinations, you can see several failed: https://github.com/raycoarana/maven-mockable-kotlin/actions/runs/2439584379

I did a complete run https://github.com/joke/maven-mockable-kotlin/actions/runs/2439625095. My best guess is the problem is operating system specific. Could you run a full test as well? And disable the maven cache. Just to be sure.

Just to clarify. You said you tested the same setup with gradle and there hasn't been a problem. Is that correct?

seems maven is actually starting the tests differently than gradle
https://github.com/joke/maven-mockable-kotlin/actions/runs/2439874014
https://github.com/joke/maven-mockable-kotlin/actions/runs/2439874023
and it seems related to the operating system version.

Yes, the issue seems to be somewhat related to execute it with Maven. About OS, yes in GH Action if fails for some OS and not in other, in my machine also fail in other configuration with a newer Ubuntu. Maybe a full run with maven traces could give us a clue about it comparing then between working and non-working executions. I will take a look when have time.

I ran the tests locally within a docker container with Ubuntu 18:04 and a matching JDK. Surprisingly everything worked just fine. Not what I expected. It's rather strange.

I added the debug level to maven and I don't see any difference :(. The only thing I see is different order of tests, but setting it to a fixed order, nothing changes. So the only anwser should be inside the Spock engine on how the initialization is done or something like that, not sure if there is a way to enable more logs on their side.

@raycoarana Could you try the new version with your setup. I did some improvements in the startup process of the byte buddy agent. The agent should start a little bit earlier during the JVM startup. This might fix the problem.

Tested locally in one Mac and in all GH Action machine now works!!! Tomorrow I will test in other two machines just to confirm, but it looks really nice!

Tested also in that other two machines, working perfectly, so let's close the issue 😄.
Many thanks for fixing this!!

@raycoarana perfect


Hide week number

how do i hide the week number

Add this into your css/custom.css (after body { })
.CX2 .weeksmark {
  display:none;
}

Thank You!!

For the week number, is it possible only to have the numbers?
Not the text after them number. How can i remove that?
Example 32nd as in this picture over.
Thanks

For the week number, is it possible only to have the numbers? Not the text after them number. How can i remove that?
Example 32nd as in this picture over.
And only have 32
Thanks

Change the weekformat option on the view to something else. Everything available is documented here: https://momentjs.com/docs/#/displaying/

For the week number, is it possible only to have the numbers? Not the text after them number. How can i remove that?
Example 32nd as in this picture over.
And only have 32
Thanks

Change the weekformat option on the view to something else. Everything available is documented here: https://momentjs.com/docs/#/displaying/

That worked Perfect. Learing new things, lovet it.
Now i have great resource also for other questions and things i have on my list.
Thank you so much for replying me.
Br Ole


pyproject.toml allows incompatible version of openMCMC

Under latest version of main and openMCMC v1.0.4, all tests under the file tests/test_model.py fail because they attempt to pass n_thin to the constructor of MCMC. Updating to openMCMC v1.0.5 resolves this and all tests pass. The version specification in pyproject.toml should be altered to reflect this.

Good spot, will change, thanks.


Auto-delete links on a WI when WI gets deleted

If we don't auto-delete the links, then we get a 404 when we query for
the links on the still existing end of a link. This is because we try to
resolve both ends of the link and the one that has been deleted
obviously cannot be found.
For now we auto-delete the links associated to a WI in the WI
controller explicitly. Later we might want to have some registration
mechanism where different systems can hook into. For now this is
overkill.
Fixes #768

Codecov Report

Merging #793 into master will increase coverage by 0.04%.
The diff coverage is 37.5%.

@@            Coverage Diff             @@
##           master     #793      +/-   ##
==========================================
+ Coverage   72.66%   72.71%   +0.04%
==========================================
  Files          83       83
  Lines        5016     5028      +12
==========================================
+ Hits         3645     3656      +11
- Misses       1025     1027       +2
+ Partials      346      345       -1

Impacted Files
Coverage Δ

workitem.go
89% <37.5%> (-2.49%)
:x:

work-item-link.go
81.13% <ø> (+3.14%)
:white_check_mark:

Continue to review full report at Codecov.

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


Looser Timeouts for L2s

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (0620fc3) 31.04% compared to head (8263c1e) 31.04%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #795   +/-   ##
=======================================
  Coverage   31.04%   31.04%
=======================================
  Files          41       41
  Lines        5370     5370
=======================================
  Hits         1667     1667
  Misses       3524     3524
  Partials      179      179

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Allow auth on mo_url

Auth can either be basic auth:
mo_url<EMAIL_ADDRESS>or via token auth:
mo_url_auth_token: 'the token to use'

@miltontony @KaitCrawford @jpaidoussi ready for review

This is a backwards compatible change.

+1


Implement Choices.reversed

Problem
I needed a form field with valid options from a Choices object, but in reverse order of definition.  Calling reversed(SomeChoicesObject) does not work, we have to convert to a list first.
From the error message (KeyError: 0), reversed seems to combine __len__ and __getitem__ and tries to get values with manual iteration, instead of doing something that would rely on __iter__.
If Choices implemented __reversed__, the obvious form would work.
Environment

Django Model Utils version: 3.0.0
Django version: 1.10.8
Python version: 3.6.3
Other libraries used, if any:

Code examples
(Pdb++) Review.Rates
Choices((1, 1, 'not great'),
        (2, 2, 'ok'),
        (3, 3, 'good'),
        (4, 4, 'great'))
(Pdb++) list(reversed(Review.Rates))
*** KeyError: 0
(Pdb++) list(reversed(iter(Review.Rates)))
*** TypeError: 'list_iterator' object is not reversible
(Pdb++) list(reversed(list(Review.Rates)))
((4, 'great'), (3, 'good'), (2, 'ok'), (1, 'not great'))

Thanks @auvipy !


开源的检测工具

https://github.com/danielstjules/jsinspect.git

检测复制粘贴和结构相似的 JavaScript 代码

https://github.com/maierfelix/Iroh.git

Iroh is a dynamic code analysis tool for JavaScript. Iroh allows to record your code flow in realtime, intercept runtime informations and manipulate program behaviour on the fly.

https://github.com/moskirathe/JScent.git

Long message chain - In code you see a series of calls resembling a->b()->c()->d()
Feature envy - A method accesses the data of another object more than its own data.
Long parameter list - A method with more than 3 parameters
Large objects - A class/object that is doing too much
Dead code - A variable, parameter, field, method or class is no longer used (usually-because it is obsolete).
Long Methods - A method contains too many lines of code
Switch statement - A switch statement with too many cases
Method comments - A method is filled with explanatory comments

https://github.com/dpnishant/jsprime.git

Variable & Function Tracing (This feature is a part of our code flow analysis algorithm)
Variable & Function Scope Aware analysis (This feature is a part of our code flow analysis- algorithm)
Known filter function aware
OOP & Protoype Compliant
Minimum False Positive alerts
Supports minified JavaScript
Blazing fast performance
Point and Click :-) (my personal favorite)

https://github.com/ajinabraham/nodejsscan.git

这个是python的一个项目， 是website 检测感觉有点意思

https://github.com/es-analysis/plato.git

Visualize JavaScript source complexity with plato. 4.5K

https://github.com/SonarSource/SonarJS.git

Advanced rules based on pattern matching and control flow analysis
~280 rules for JavaScript and TypeScript
~30 rules for CSS
Compatible with ECMAScript 2015-2020
React JSX, Flow and Vue support for JavaScript and TypeScript
CSS, SCSS, Less, also 'style' inside PHP, HTML and VueJS files
Metrics (complexity, number of lines etc.)
Import of test coverage reports
Import of ESLint, TSLint and Stylelint issues


update clinical reasoning version

superseded by https://github.com/cqframework/cqf-ruler/pull/789


Support validation query

JDBC Sniffer should consider the validateOnBorrow property of the connection pool

It might be correct to count the validation query as well; decision postponed till 3.0 or other version

Not a bug


history builtin + arrow keys

Handling arrow keys is more complicated than I though...looks like we need to set some terminal attributes or use a larger library like ncurses but I'd rather stay lean.
See http://man7.org/linux/man-pages/man3/termios.3.html.