Parsing NTriple with bnode fails if bnode lable contains "-"

As per N triple spec https://www.w3.org/TR/n-triples/#BNodes below is allowed

2.4 RDF Blank Nodes
RDF blank nodes in N-Triples are expressed as _: followed by a blank node label which is a series of name characters. The characters in the label are built upon PN_CHARS_BASE, liberalized as follows:
The characters _ and [0-9] may appear anywhere in a blank node label.
The character . may appear anywhere except the first or last character.
The characters -, U+00B7, U+0300 to U+036F and U+203F to U+2040 are permitted anywhere except the first character.

But if I try to parse below
Rio.parse(new StringReader("<http://example.org/people/alice> <http://www.perceive.net/schemas/relationship/enemyOf> _:genid-7047e9358ae44bd190d9f22a25762c2b-b1 ."), "", RDFFormat.NTRIPLES)

it fails with exception
org.eclipse.rdf4j.rio.RDFParseException: Expected '.', found: - [line 1]

	at org.eclipse.rdf4j.rio.helpers.RDFParserHelper.reportError(RDFParserHelper.java:322)
	at org.eclipse.rdf4j.rio.helpers.AbstractRDFParser.reportError(AbstractRDFParser.java:684)
	at org.eclipse.rdf4j.rio.ntriples.NTriplesParser.reportError(NTriplesParser.java:636)
	at org.eclipse.rdf4j.rio.ntriples.NTriplesParser.parseTriple(NTriplesParser.java:298)
	at org.eclipse.rdf4j.rio.ntriples.NTriplesParser.parse(NTriplesParser.java:177)
	at org.eclipse.rdf4j.rio.Rio.parse(Rio.java:343)
	at org.eclipse.rdf4j.rio.Rio.parse(Rio.java:254)

@jeenbroekstra any thoughts on this? If you guys agree that parser should allow extra characters mentioned in spec then I can try to create a patch for it.

Yeah that seems like a bug. A patch would be most welcome! Can you add a test case as well so we don't regress? Thanks!

@jeenbroekstra below are the test cases and code change required to fix it. If it looks ok then I can signup and do proper PR etc.
   @Test
    public void testBlankNodeIdentifiersWithUnderScore()
            throws Exception
    {
        //The characters _ and [0-9] may appear anywhere in a blank node label.
        RDFParser ntriplesParser = new NTriplesParser();
        Model model = new LinkedHashModel();
        ntriplesParser.setRDFHandler(new StatementCollector(model));
        ntriplesParser.parse(new StringReader("_:123_ <urn:test:predicate> _:_456 ."), NTRIPLES_TEST_URL);

        assertEquals(1, model.size());
        assertEquals(1, model.subjects().size());
        assertEquals(1, model.predicates().size());
        assertEquals(1, model.objects().size());
    }

    @Test
    public void testBlankNodeIdentifiersWithDot()
            throws Exception
    {
        //The character . may appear anywhere except the first or last character.
        RDFParser ntriplesParser = new NTriplesParser();
        Model model = new LinkedHashModel();
        ntriplesParser.setRDFHandler(new StatementCollector(model));
        ntriplesParser.parse(new StringReader("_:1.23 <urn:test:predicate> _:45.6 ."), NTRIPLES_TEST_URL);

        assertEquals(1, model.size());
        assertEquals(1, model.subjects().size());
        assertEquals(1, model.predicates().size());
        assertEquals(1, model.objects().size());
    }

    @Test
    public void testBlankNodeIdentifiersWithDotAsFirstCahracter()
            throws Exception
    {
        //The character . may appear anywhere except the first or last character.
        RDFParser ntriplesParser = new NTriplesParser();
        Model model = new LinkedHashModel();
        ntriplesParser.setRDFHandler(new StatementCollector(model));
        try {
            ntriplesParser.parse(new StringReader("_:123 <urn:test:predicate> _:.456 ."), NTRIPLES_TEST_URL);
            fail("Should have failed to parse invalid N-Triples bnode with '.' at the begining of the bnode label");
        } catch (Exception e) {
        }

        assertEquals(0, model.size());
        assertEquals(0, model.subjects().size());
        assertEquals(0, model.predicates().size());
        assertEquals(0, model.objects().size());
    }

    @Test(expected = RDFParseException.class)
    public void testBlankNodeIdentifiersWithDotAsLastCahracter()
            throws Exception
    {
        //The character . may appear anywhere except the first or last character.
        RDFParser ntriplesParser = new NTriplesParser();
        Model model = new LinkedHashModel();
        ntriplesParser.setRDFHandler(new StatementCollector(model));
        try {
            ntriplesParser.parse(new StringReader("_:123 <urn:test:predicate> _:456. ."), NTRIPLES_TEST_URL);
        } catch (RDFParseException e) {
            assertEquals(0, model.size());
            assertEquals(0, model.subjects().size());
            assertEquals(0, model.predicates().size());
            assertEquals(0, model.objects().size());
            throw e;
        }
        fail("Should have failed to parse invalid N-Triples bnode with '.' at the end of the bnode label");
    }

    @Test
    public void testBlankNodeIdentifiersWithOtherCharacters()
            throws Exception
    {
        //The characters -, U+00B7, U+0300 to U+036F and U+203F to U+2040 are permitted anywhere except the first character.
        List<Character> charactersList = new ArrayList<>();
        charactersList.add('-');
        charactersList.add('\u00B7');
        charactersList.add('\u0300');
        charactersList.add('\u036F');
        charactersList.add('\u0301');
        charactersList.add('\u203F');

        for(int i = 0;i < charactersList.size(); i++) {
            Character character = charactersList.get(i);
            RDFParser ntriplesParser = new NTriplesParser();
            Model model = new LinkedHashModel();
            ntriplesParser.setRDFHandler(new StatementCollector(model));

            String triple = "<urn:test:subject> <urn:test:predicate> _:1" + character + " . ";
            try {
                ntriplesParser.parse(new StringReader(triple), NTRIPLES_TEST_URL);
            } catch (Exception e) {
                fail(" Failed to parse triple : "+triple+" containing character '"+character+"' at index "+i+" in charactersList" );
            }

            assertEquals("Should parse '"+character+"'", 1, model.size());
            assertEquals("Should have subject when triple has character : '"+character+"'", 1, model.subjects().size());
            assertEquals("Should have predicate when triple has character : '"+character+"'",1, model.predicates().size());
            assertEquals("Should have object when triple has character : '"+character+"'",1, model.objects().size());
        }

    }

    @Test(expected = RDFParseException.class)
    public void testBlankNodeIdentifiersWithOtherCharactersAsFirstCharacter()
            throws Exception
    {
        //The characters -, U+00B7, U+0300 to U+036F and U+203F to U+2040 are permitted anywhere except the first character.
        List<Character> charactersList = new ArrayList<>();
        charactersList.add('-');
        charactersList.add('\u00B7');
        charactersList.add('\u0300');
        charactersList.add('\u036F');
        charactersList.add('\u0301');
        charactersList.add('\u203F');

        for(Character character:charactersList) {
            RDFParser ntriplesParser = new NTriplesParser();
            Model model = new LinkedHashModel();
            ntriplesParser.setRDFHandler(new StatementCollector(model));

            try {
                ntriplesParser.parse(new StringReader("<urn:test:subject> <urn:test:predicate> _:"+character+"1 . "), NTRIPLES_TEST_URL);
            } catch (RDFParseException e) {
                assertEquals(0, model.size());
                assertEquals(0, model.subjects().size());
                assertEquals(0, model.predicates().size());
                assertEquals(0, model.objects().size());
                throw e;
            }
            fail("Should have failed to parse invalid N-Triples bnode with '"+character+"' at the begining of the bnode label");
        }
    }

And to fix it adding in NTriplesUtil.java
    /**
     * Checks whether the supplied character is in list of liberal characters according to the N-Triples specification.
     *
     */
    public static boolean isInLiberalCharacterList(int c) {
        return isUnderscore(c) || isDot(c) || c == 45 || c == 183 || (c >= 768 && c <= 879) || c == 8255 || c == 8256;
    }

    /**
     * Checks whether the supplied character is Underscore.
     *
     */
    public static boolean isUnderscore(int c) {
        return c == 95;
    }

    /**
     * Checks whether the supplied character is Dot '.'.
     *
     */
    public static boolean isDot(int c) {
        return c == 46;
    }

    /**

in NTriplesParser.java
	protected int parseNodeID(int c, StringBuilder name)
		throws IOException, RDFParseException
	{
		if (c != '_') {
			reportError("Supplied char should be a '_', is: " + new String(Character.toChars(c)),
					NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES);
		}

		c = readCodePoint();
		if (c == -1) {
			throwEOFException();
		}
		else if (c != ':') {
			reportError("Expected ':', found: " + new String(Character.toChars(c)),
					NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES);
		}

		c = readCodePoint();
		if (c == -1) {
			throwEOFException();
		}
		else if (!NTriplesUtil.isLetterOrNumber(c) && !NTriplesUtil.isUnderscore(c)) {
			reportError("Expected a letter or number, found: " + new String(Character.toChars(c)),
					NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES);
		}
		name.append(Character.toChars(c));

		// Read all following letter and numbers, they are part of the name
		c = readCodePoint();
		int last = -1;
		while (c != -1 && (NTriplesUtil.isLetterOrNumber(c) || NTriplesUtil.isInLiberalCharacterList(c))) {
			name.append(Character.toChars(c));
			last = c;
			c = readCodePoint();
		}

		if (NTriplesUtil.isDot(last)) {
			reportError("Expected a letter or number, found: " + new String(Character.toChars(c)),
					NTriplesParserSettings.FAIL_ON_NTRIPLES_INVALID_LINES);
		}

		return c;
	}

Looks good to me. But it will be easier to review in an actual PR (also because then I can check out the code and run it locally, if necessary).

If you need a hand setting up a PR just sing out, happy to talk you through it!

cool thanks for quick check I was about to raise a PR. But Just noticed a small problem and it seems like a conflict in spec. As per existing test below is valid and should parse
# Space is optional before final .

<http://example.org/resource15> <http://example.org/property> _:anon.

But as per liberalized spec

The character . may appear anywhere except the first or last character

How do we want to treat dot? Can we do below?

Raise parsing exception If dot is first or last character for subject or dot is first character of object.

However it means we need to pass a flag to parseNodeId method or create 2 methods. It seems that from performance perspective second will be better. What do you guys think?

In the above existing test, the final dot is not part of the URI/blank node, but is the full-stop at the end of the triple. The test is there because separating the resource id and the end-of-triple fullstop with a whitespace is optional. So there's no conflict, we simply need to ensure that if this situation occurs the parser does not treat the fullstop as part of the resource id.

I would suggest that the way to treat this is to have parseNodeId not raise an exception on encountering a fullstop at the end, ever, and just let the context handle it. From the top of my head, if the node id is in the subject/predicate position, the parser will next jump to parse the predicate/object, which should then fail on an unexpected full stop.

Sorry I think I was not very clear. What I was trying to say is same as you suggest. But was not sure about the best way to do it? Because . is allowed in the middle how can we determine without reading ahead in the stream that it is actully in the middle? Do we add a buffer which keeps record of previous and last character?
For example let us take 2 cases.

This is valid node name

<http://example.org/resource> <http://example.org/property> _:a.b

This is valid and full stop at the end is indicating end-of-triple

<http://example.org/resource> <http://example.org/property> _:ab.

At the moment loop to read codePoints in parseNodeID method is as below. As only letterOrNumber is allowed it workds quite well without any need to track previous or last codePoint.
		c = readCodePoint();
		while (c != -1 && NTriplesUtil.isLetterOrNumber(c)) {
			name.append(Character.toChars(c));
			c = readCodePoint();
		}

But when we allow . in the middle of the name i.e. _:a.b and . at the end is treated as end-of-triple then the above loop will require to check that there is another valid codePoint after . before it goes in the nodeName. Feels like we will end up some sort buffer(an instance variable or array) to implement this check. What do you think?
On separate note, As rest of the test cases are passing shall I raise PR for scenarios excluding . or you prefer all in one go?

Ah I see. You don't need a separate buffer really, I think. You can use a similar trick to what the TurtleParser also does in these cases. It has a peekCodePoint method that looks like this:
protected int peekCodePoint() throws IOException {
	int result = readCodePoint();
	unread(result);
	return result;
}

protected void unread(int codePoint) throws IOException {
	if (codePoint != -1) {
		if (Character.isSupplementaryCodePoint(codePoint)) {
			final char[] surrogatePair = Character.toChars(codePoint);
			reader.unread(surrogatePair);
		} else {
			reader.unread(codePoint);
		}
	}
}

You should be able to reuse something similar in NTriplesParser to look at the next character without advancing the reader.

As for the PR: just put it up, we can review and continue discussion on further tweaks there, and you can also add additional commits to the PR later if necessary :)

@jeenbroekstra wonderfull!
I was thinking in same direction but did not realize that something must have been already done in other parser. Thanks for the pointers. I have raised PR for it.


Stuck in a loop with the deploy button

I'm stuck in a loop with the deploy button (it never completes).
Primo version: latest
I've already added the following to Supabase
alter table symbols
add column index integer;

Despite this, and even after trying with a new GitHub token, the issue persists.

Okay should be fixed now. Looks like it was just a corrupted block in that theme so no need to update, just recreate your site with the same theme. Thanks for pointing that out!


Fail to run explanation sample

/kind bug
What steps did you take and what happened:
[A clear and concise description of what the bug is.]
When I run sample  in https://github.com/kubeflow/kfserving/tree/master/docs/samples/explanation/alibi, kfserving controller crashed with nil pointer error
What did you expect to happen:
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
Environment:

Istio Version:
Knative Version:
KFServing Version:
Kubeflow version:
Minikube version:
Kubernetes version: (use kubectl version):
OS (e.g. from /etc/os-release):

/assign


Feature/yarn 11391

Description of PR
The patch reuses the resolver introduced from the HDFS side and apply similar logic to YARN RM service addresses resolving.
To utilize the YARN DNS support and use DNS as endpoint, simply upgrade the hadoop binary and revise configs from, for example:
 <property>
   <name>yarn.resourcemanager.address.rm1</name>
   <value>rm1_address:8032</value>
 </property>
 <property>
   <name>yarn.resourcemanager.scheduler.address.rm1</name>
   <value>rm1_address:8030</value>
 </property>
 <property>
   <name>yarn.resourcemanager.resource-tracker.address.rm1</name>
   <value>rm1_address:8031</value>
 </property>
 <property>
   <name>yarn.resourcemanager.admin.address.rm1</name>
   <value>rm1_address:8033</value>
 </property>
 <property>
   <name>yarn.resourcemanager.webapp.address.rm1</name>
   <value>rm1_address:8088</value>
 </property>
 <property>
   <name>yarn.resourcemanager.webapp.https.address.rm1</name>
   <value>rm1_address:8090</value>
 </property>
 <property>
   <name>yarn.resourcemanager.address.rm2</name>
   <value>rm2_address:8032</value>
 </property>
 <property>
   <name>yarn.resourcemanager.scheduler.address.rm2</name>
   <value>rm2_address:8030</value>
 </property>
 <property>
   <name>yarn.resourcemanager.resource-tracker.address.rm2</name>
   <value>rm2_address:8031</value>
 </property>
 <property>
   <name>yarn.resourcemanager.admin.address.rm2</name>
   <value>rm2_address:8033</value>
 </property>
 <property>
   <name>yarn.resourcemanager.webapp.address.rm2</name>
   <value>rm2_address:8088</value>
 </property>
 <property>
   <name>yarn.resourcemanager.webapp.https.address.rm2</name>
   <value>rm2_address:8090</value>
 </property>
 <property>
   <name>yarn.resourcemanager.ha.rm-ids</name>
   <value>rm1,rm2</value>
 </property>

to:
<property>
  <name>yarn.resourcemanager.address.rm1</name>
  <value>rm_multi_a_dns:8032</value>
</property>
<property>
  <name>yarn.resourcemanager.scheduler.address.rm1</name>
  <value>rm_multi_a_dns:8030</value>
</property>
<property>
  <name>yarn.resourcemanager.resource-tracker.address.rm1</name>
  <value>rm_multi_a_dns:8031</value>
</property>
<property>
  <name>yarn.resourcemanager.admin.address.rm1</name>
  <value>rm_multi_a_dns:8033</value>
</property>
<property>
  <name>yarn.resourcemanager.webapp.address.rm1</name>
  <value>rm_multi_a_dns:8088</value>
</property>
<property>
  <name>yarn.resourcemanager.webapp.https.address.rm1</name>
  <value>rm_multi_a_dns:8090</value>
</property>
<property>
  <name>yarn.resourcemanager.ha.rm-ids</name>
  <value>rm1</value>
</property>
<property>
  <name>yarn.resourcemanager.ha.resolve-needed</name>
  <value>true</value>
</property>
<property>
  <name>yarn.resourcemanager.ha.resolver.useFQDN</name>
  <value>true</value> # required in secure mode
</property>
<property>
  <name>yarn.resourcemanager.ha.refresh-period-ms</name>
  <value>180000</value> # 3 min
</property>

where rm_multi_a_dns is a multi-A DNS record for rm1_address and rm2_address. This means the following output on the terminal.
$ dig +short <rm_multi_a_dns> | xargs -n +1 dig +short -x | sort
<rm1_address>
<rm2_address>
For the newly introduced flags, please refer to yarn-default.xml.
How was this patch tested?
For code changes:

[ ] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
[ ] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
[ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
[ ] If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Logfile
Comment

+0 :ok:
reexec
0m 38s

Docker mode activated.

_ Prechecks _

+1 :green_heart:
dupname
0m  0s

No case conflicting files found.

+0 :ok:
codespell
0m  0s

codespell was not available.

+0 :ok:
detsecrets
0m  0s

detect-secrets was not available.

+0 :ok:
xmllint
0m  0s

xmllint was not available.

+1 :green_heart:
@author
0m  0s

The patch does not contain any @author tags.

+1 :green_heart:
test4tests
0m  0s

The patch appears to include 2 new or modified test files.

_ trunk Compile Tests _

+0 :ok:
mvndep
15m 17s

Maven dependency ordering for branch

+1 :green_heart:
mvninstall
25m 45s

trunk passed

+1 :green_heart:
compile
23m 11s

trunk passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04

+1 :green_heart:
compile
20m 22s

trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08

+1 :green_heart:
checkstyle
3m 44s

trunk passed

+1 :green_heart:
mvnsite
3m 44s

trunk passed

-1 :x:
javadoc
1m 11s
/branch-javadoc-hadoop-common-project_hadoop-common-jdkUbuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.txt
hadoop-common in trunk failed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.

+1 :green_heart:
javadoc
2m 42s

trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08

+1 :green_heart:
spotbugs
6m 50s

trunk passed

+1 :green_heart:
shadedclient
22m  2s

branch has no errors when building and testing our client artifacts.

_ Patch Compile Tests _

+0 :ok:
mvndep
0m 28s

Maven dependency ordering for patch

+1 :green_heart:
mvninstall
2m 26s

the patch passed

+1 :green_heart:
compile
22m 19s

the patch passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04

+1 :green_heart:
javac
22m 19s

the patch passed

+1 :green_heart:
compile
20m 34s

the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08

+1 :green_heart:
javac
20m 34s

the patch passed

+1 :green_heart:
blanks
0m  0s

The patch has no blanks issues.

-0 :warning:
checkstyle
3m 35s
/results-checkstyle-root.txt
root: The patch generated 2 new + 184 unchanged - 0 fixed = 186 total (was 184)

+1 :green_heart:
mvnsite
3m 45s

the patch passed

-1 :x:
javadoc
1m  6s
/patch-javadoc-hadoop-common-project_hadoop-common-jdkUbuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.txt
hadoop-common in the patch failed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.

+1 :green_heart:
javadoc
2m 40s

the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08

-1 :x:
spotbugs
2m  6s
/new-spotbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-common.html
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)

+1 :green_heart:
shadedclient
21m 44s

patch has no errors when building and testing our client artifacts.

_ Other Tests _

+1 :green_heart:
unit
18m 15s

hadoop-common in the patch passed.

+1 :green_heart:
unit
1m 16s

hadoop-yarn-api in the patch passed.

+1 :green_heart:
unit
5m 44s

hadoop-yarn-common in the patch passed.

+1 :green_heart:
asflicense
1m  3s

The patch does not generate ASF License warnings.

243m 43s

Reason
Tests

SpotBugs
module:hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common

Inconsistent synchronization of org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider.rmServiceIds; locked 90% of time  Unsynchronized access at RequestHedgingRMFailoverProxyProvider.java:90% of time  Unsynchronized access at RequestHedgingRMFailoverProxyProvider.java:[line 147]

Subsystem
Report/Notes

Docker
ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5279/1/artifact/out/Dockerfile

GITHUB PR
https://github.com/apache/hadoop/pull/5279

Optional Tests
dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint

uname
Linux 8e9041b7eec2 4.15.0-200-generic #211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Build tool
maven

Personality
dev-support/bin/hadoop.sh

git revision
trunk / 0d3e0ef41b65b77e229f25c6b1ea54c048cd30fe

Default Java
Private Build-1.8.0_352-8u352-ga-1~20.04-b08

Multi-JDK versions
/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_352-8u352-ga-1~20.04-b08

Test Results
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5279/1/testReport/

Max. process+thread count
1291 (vs. ulimit of 5500)

modules
C: hadoop-common-project/hadoop-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common U: .

Console output
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5279/1/console

versions
git=2.25.1 maven=3.6.3 spotbugs=4.2.2

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

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Logfile
Comment

+0 :ok:
reexec
0m 35s

Docker mode activated.

_ Prechecks _

+1 :green_heart:
dupname
0m  0s

No case conflicting files found.

+0 :ok:
codespell
0m  0s

codespell was not available.

+0 :ok:
detsecrets
0m  0s

detect-secrets was not available.

+0 :ok:
xmllint
0m  0s

xmllint was not available.

+1 :green_heart:
@author
0m  0s

The patch does not contain any @author tags.

+1 :green_heart:
test4tests
0m  0s

The patch appears to include 2 new or modified test files.

_ trunk Compile Tests _

+0 :ok:
mvndep
15m 15s

Maven dependency ordering for branch

+1 :green_heart:
mvninstall
30m 35s

trunk passed

+1 :green_heart:
compile
22m 55s

trunk passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04

+1 :green_heart:
compile
20m 26s

trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08

+1 :green_heart:
checkstyle
3m 47s

trunk passed

+1 :green_heart:
mvnsite
3m 43s

trunk passed

-1 :x:
javadoc
1m 13s
/branch-javadoc-hadoop-common-project_hadoop-common-jdkUbuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.txt
hadoop-common in trunk failed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.

+1 :green_heart:
javadoc
2m 39s

trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08

+1 :green_heart:
spotbugs
6m 37s

trunk passed

+1 :green_heart:
shadedclient
25m  7s

branch has no errors when building and testing our client artifacts.

_ Patch Compile Tests _

+0 :ok:
mvndep
0m 28s

Maven dependency ordering for patch

+1 :green_heart:
mvninstall
2m 32s

the patch passed

+1 :green_heart:
compile
22m 19s

the patch passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04

+1 :green_heart:
javac
22m 19s

the patch passed

+1 :green_heart:
compile
20m 28s

the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08

+1 :green_heart:
javac
20m 28s

the patch passed

+1 :green_heart:
blanks
0m  0s

The patch has no blanks issues.

-0 :warning:
checkstyle
3m 38s
/results-checkstyle-root.txt
root: The patch generated 2 new + 184 unchanged - 0 fixed = 186 total (was 184)

+1 :green_heart:
mvnsite
3m 43s

the patch passed

-1 :x:
javadoc
1m  6s
/patch-javadoc-hadoop-common-project_hadoop-common-jdkUbuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.txt
hadoop-common in the patch failed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.

+1 :green_heart:
javadoc
2m 39s

the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08

-1 :x:
spotbugs
2m  2s
/new-spotbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-common.html
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)

+1 :green_heart:
shadedclient
24m 53s

patch has no errors when building and testing our client artifacts.

_ Other Tests _

+1 :green_heart:
unit
18m 17s

hadoop-common in the patch passed.

-1 :x:
unit
1m 14s
/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-api.txt
hadoop-yarn-api in the patch passed.

+1 :green_heart:
unit
5m 44s

hadoop-yarn-common in the patch passed.

+1 :green_heart:
asflicense
1m  1s

The patch does not generate ASF License warnings.

254m 44s

Reason
Tests

SpotBugs
module:hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common

Inconsistent synchronization of org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider.rmServiceIds; locked 90% of time  Unsynchronized access at RequestHedgingRMFailoverProxyProvider.java:90% of time  Unsynchronized access at RequestHedgingRMFailoverProxyProvider.java:[line 147]

Failed junit tests
hadoop.yarn.conf.TestYarnConfigurationFields

Subsystem
Report/Notes

Docker
ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5279/2/artifact/out/Dockerfile

GITHUB PR
https://github.com/apache/hadoop/pull/5279

Optional Tests
dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint

uname
Linux 91815f70c38f 4.15.0-200-generic #211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Build tool
maven

Personality
dev-support/bin/hadoop.sh

git revision
trunk / 8ba69563a39bc8b2c5cdc09e5b512d87ef23da17

Default Java
Private Build-1.8.0_352-8u352-ga-1~20.04-b08

Multi-JDK versions
/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_352-8u352-ga-1~20.04-b08

Test Results
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5279/2/testReport/

Max. process+thread count
1403 (vs. ulimit of 5500)

modules
C: hadoop-common-project/hadoop-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common U: .

Console output
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5279/2/console

versions
git=2.25.1 maven=3.6.3 spotbugs=4.2.2

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

This message was automatically generated.


Searching for multiple Event IDs over a time frame

What is the problem with below correlation rule , it throwing out errors in test run.
# From example_rules/example_frequency.yaml
es_host: http://localhost:8983/solr/
es_port: 8983
name:hunk-final
type: frequency
index: logstash-*
num_events: 50
timeframe:
    minutes: 30
filter:
filter:
- and:
    - term:
        field: "4618"
    - and:
    - term:
        field: "4912"
- and:
        term:
          field: "4907"
        - or:
        term:
           field: "4660"
        - or:
         term:
           field: "4670"
        - or:
         term:
           field: "4691"
- and:
        term:
          field: "4964"
        - or:
        term:
           field: "4767"
        - or:
         term:
           field: "4758"
        - or:
         term:
           field: "4757"
        - or:
         term:
           field: "4753"
        - or:
         term:
           field: "4750"
        - or:
         term:
           field: "4743"
        - or:
         term:
           field: "4740"
- and:
        term:
          field: "5025"
        - or:
        term:
           field: "5034"
        - or:
         term:
           field: "4950"
        - or:
         term:
           field: "4949"
alert:
- "email"

It would be helpful if you could actually post the error.
But, I think I see the issue.
es_host: http://localhost:8983/solr/

should be
es_host: localhost
es_url_prefix: solr


Add background color to mobile tab bar to fill gaps caused by rounding

When the available space is not a factor of 5, we get 1px white gaps interspersed between the items. By using the same background color as the tabs, we can hide this visual artifact.
Background colored orange for demonstration:

Change result:

:eyeglasses: @keybase/react-hackers

👍


kitchen and chef-zero 404ing on data bag

Hi,
I think I've read previous issues with the same problem but I still cannot get data bags working with test-kichen. I get:
[2016-02-06T18:53:23+00:00] ERROR: Failed to load data bag item: "rabbit" "client"
Net::HTTPServerException
       ------------------------
       404 "Not Found"

My data bag is ..
$ ls test/data_bags
rabbit.json

$ cat test/data_bags/rabbit.json
{
    "id": "rabbit",
    "client": "foo"
}

The specification for kitchen is ...
$ cat .kitchen.yml
...
provisioner:
  name: chef_zero
...
suites:
  - name: monitor
    run_list: [ "recipe[my_it::monitor]" ]
    data_bags_path: test/data_bags
    provisioner:
      client_rb:
        environment: dev

could you please run
kitchen diagnose monitor

sorry to read this so late, but that's not the correct way to create a data bag.
Have a look at http://atomic-penguin.github.io/blog/2013/06/07/HOWTO-test-kitchen-and-encrypted-data-bags/ , but you should have a directory structure test/data_bags/rabbit with a file client.json.

test

What should be the approach to use kitchen to test policies which have databag references. Any help....


[T4A2][F09-B4]Poh Yee Heng

Good job!!

@Yeehengg Some comments added. Please close the PR after reading comments.


Update rules to use a list item instead of a string value for reference

Several rules use a string value to define a reference. This can cause issues in calling code as the value may be a list or a string. Checking the defined format states that this field lists related information, so I believe this should always be a list of references.
Updated format.md to define the field as a list of related info.
Updated these rules to define the reference value as a list entry.

thank you @idiom! great catches.
we'll also update the linter to assert that the references are the correct type.

great, thanks!


Network: IP mapping

This PR allows topologies with more than 2 clusters. In particular, it implements the firewalling and routing rules related to the externalCIDR.
The main features are:

communication between leaf nodes
make a service (located outside of the cluster) reachable.

/merge


0.9b3 Trip report

Stratux version:  0.9b3 stratux-v0.9b3-9d3060af95.sh

Stratux config:
SDR
[ ] single
[ X ] dual
GPS
[ X ] yes
[ ] no
type: VK-172
AHRS
[ ] yes
[ N ] no
R-Pi
[ ] Zero
[ X ] 2B
[ ] 3
power source:  Ship power
usb cable:  Anker HD

EFB app and version: (e.g., WingX Pro7 8.6.2)   DroidEFB 2.1.3
EFB platform: (e.g., iOS 9.2)  Android KitKat
EFB hardware: (e.g., iPad Mini 2)  ASUS TF300 Table / LG G3

Description of your issue:
I got about 4 hours of flying in with 0.9b3 today.  Prior to departure I started Stratux, connected the EFB devices and enabled logging (not verbose).

While on climb out to altitude (IFR flight plan) I received an EFB warning " No GPS signal or signal suspect" warning.  I switched to my device's internal GPS and waited until time would to troubleshoot.
Once at altitude, I switch to the Statux Web UI and saw a list of "WARNING SQLite lite logging behind".  I disabled logging and tried to connect to the GPS again.  No joy.  Note, at this time I was still receiving traffic, Weather and NexRad updates.  I had to turn off logging and report Stratux to recover the GPS connection.
Turning logging back on it only took about 5 minutes for the problem to reappear.  I rebooted again and left logging of for the rest of my flight.  I did not have and GPS connection issues with the logging turned off.  Note: This happened with both devices I had connected to Stratux.
Edit: Added screenshots.  Added R-Pi type.
Screenshot of Logging Errors:

Screen shot of EFB warning:

Screenshot showing EFB GPS source:

Screenshot showing received towers:

Screenshot after reboot attempt:

Screenshot after and extended logging period:

If possible, enable "Replay Logs", reproduce the problem, and provide a copy of the logs in http://<IP_ADDRESS>/logs/stratux/ and http://<IP_ADDRESS>/logs/stratux.log.  I'll see if anything was captured in the logs.

Kinda cross posting here, 'cause I said this under another issue. I flew 2 hours today w/ v0.9b2 (fresh image) with no issues. BU-353. Logging disabled. NEXRAD coming in. Guess I'll have to put "Enable logging" on my test card for next time.
Interestingly, no AIRMETs issued today, despite there being mod turb.

No issues after turning off logging in 0.9b3.  The my entire 2 hour return flight - sans logging - was without error.

Am thinking this has been fixed and so this issue can be closed? I inadvertently enabled sqlite logging a few days ago with v1.3.b2. Ran for at least an hour with no error messages.


chore: update ui core and widgets

This updates the UI core dependency and introduces app-runtime and ui-widgets for the new headerbar. It removes some of the required workarounds that were in-place for the old UI library.
The HeaderBar in UI widgets now supports custom logos again:

This probably needs backporting to as far back as we un-ejected the dashboard app, I haven't yet checked how far that is.

@jenniferarnesen would you mind taking a look at this as well before i merge it?


Battles being instantly forced to a draw by the system / One person not being pulled into the fight

Battle #10763
Attacker was not pulled into fight but target was

Believe this has not been resolved with the recent changes to battles and addition of row locking. Closing issue out.


[hotfix][javadoc] Misprint in javadoc at QuadFunction.java

What is the purpose of the change
This is a trivial PR fixing a misprint at flink-core/src/main/java/org/apache/flink/util/function/QuadFunction.java
@oaram => @param
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): ( no)
The public API, i.e., is any changed class annotated with @Public(Evolving): ( no)
The serializers: (no)
The runtime per-record code paths (performance sensitive): ( no)
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: ( no )
The S3 file system connector: ( no)

Documentation

Does this pull request introduce a new feature? ( no)
If yes, how is the feature documented? (not applicable)

@MartijnVisser sorry for the poke.
Could you please have a look once you have time?


Updated to the skipWaiting docs and related recipe

R: @philipwalton
This accounts for changes in Workbox 4.1.0.
[WF_IGNORE:TEMPLATE_TAGS]

Here's what the updated recipe looks like, since it's a little hard to make things out in the diff:
<script type="module">
import {Workbox} from 'https://storage.googleapis.com/workbox-cdn/releases/4.1.0/workbox-window.prod.mjs';

if ('serviceWorker' in navigator) {
  const wb = new Workbox('/sw.js');

  // Add an event listener to detect when the registered
  // service worker has installed but is waiting to activate.
  wb.addEventListener('waiting', (event) => {
    // `event.wasWaitingBeforeRegister` will be true if this is
    // the first time the updated service worker is waiting.
    // When `event.wasWaitingBeforeRegister` is false, a previously
    // updated same service worker is still waiting.
    // You may want to customize the UI prompt accordingly.

    // Assumes your app has some sort of prompt UI element
    // that a user can either accept or reject.
    const prompt = createUIPrompt({
      onAccept: async () => {
        // Assuming the user accepted the update, set up a listener
        // that will reload the page as soon as the previously waiting
        // service worker has taken control.
        wb.addEventListener('controlling', (event) => {
          window.location.reload();
        });

        // Send a message telling the service worker to skip waiting.
        // This will trigger the `controlling` event handler above.
        // Note: for this to work, you have to add a message
        // listener in your service worker. See below.
        wb.messageSW({type: 'SKIP_WAITING'});
      },

      onReject: () => {
        prompt.dismiss();
      }
    })
  });

  wb.register();
}
</script>

Whoops!
There were 9 warnings that will prevent this PR from being merged. Please take a look, and either fix, or provide a justification for why they can't be fixed.
WARNINGS
src/content/en/tools/workbox/_shared/config/single/skipWaiting.html#L34 - Consider adding a "was this page helpful?" widget to your page: https://developers.google.com/web/resources/widgets#helpful
src/content/en/tools/workbox/guides/advanced-recipes.md#L21 - '

Whoops!
There were 9 warnings that will prevent this PR from being merged. Please take a look, and either fix, or provide a justification for why they can't be fixed.
WARNINGS
src/content/en/tools/workbox/_shared/config/single/skipWaiting.html#L34 - Consider adding a "was this page helpful?" widget to your page: https://developers.google.com/web/resources/widgets#helpful
src/content/en/tools/workbox/guides/advanced-recipes.md#L21 - '

:tada: This has been pushed live to https://developers.google.com/web/


Warning using AWS EKS module

Description
Warning using aws eks module
Versions

Module version: 18.21.0

Terraform version: 1.2.1

Provider version(s):
aws = {
source  = "hashicorp/aws"
version = "4.15.1"
}
kubernetes = {
source  = "hashicorp/kubernetes"
version = "2.11.0"
}

Reproduction Code
Steps to reproduce the behavior:
Simple use of module in a project
Expected behavior
No warnings
Actual behavior
Warning: Redundant ignore_changes element  on .terraform/modules/eks_cluster/main.tf line 305, in resource "aws_eks_addon" "this": 305: resource "aws_eks_addon" "this" { Adding an attribute name to ignore_changes tells Terraform to ignore future changes to the argument in configuration after the object has been created, retaining the value originally configured. The attribute modified_at is decided by the provider alone and therefore there can be no configured value to compare with. Including this attribute in ignore_changes has no effect. Remove the attribute from ignore_changes to quiet this warning.

Duplicate of #2081


Align image to the right with scale type center crop

Default behavior aligns the image to the center. Reading through the closed issues I've found that you can provide new ImageViewState(0, new PointF(0,0), 0) while setting the image, which aligns the image to the left.
I've tried increasing the x coordinate of the PointF, but no matter the value it's always aligned to the top left corner.
Is there any way to align the end of the image to the top right corner?

While it's not possible providing the initial state with setImage, it works calling setScaleAndCenter during onReady.


[Feature request] Prevent hard refresh requirement on new release

Whenever LNbits has a new release, lots of users see only parts of the GUI or none at all / blank page.
Even the advanced users fail to understand immediately, that a hard refresh is needed.
Describe the solution you'd like
Cache busting on new release
Possible solution could be to give a version to static files (e.g. /static/js/script.js?v=1.0) on release-build.

Good idea. Definitely support. If no cache busting at least tell the user to hard refresh with a pop up or something

could be to give a version to static files (e.g. /static/js/script.js?v=1.0)

Another option is to use /static/js/script.js?h=abcdef where abcdef is the sha256 of the file
I've seen this in some javascript deployments

It seems there is a https://pypi.org/project/fastapi-static-digest/ which does even more advanced thing:
it mounts the file /static/app.css as /static/app.92fede82119d2e012f890e1102080a45.css where 92fede82119d2e012f890e1102080a45 is the has of app.css contents.


rc/2.24.1

Description
LEARNER-8113

Release 2.24.1

Travis-ci builds now get passed, So ready for the review. @miankhalid @omerhabib26.


Partners summary form

Pull Request Template
Issue
#298
Addresses # (issue)

[x] This change addresses the issue in full
[ ] This change addresses only certain aspects of the issue
[ ] This change is a dependency for another issue
[ ] This change has a dependency from another issue

Description
When a partner goes to edit a listing, they can toggle between a "Unit Types" and "Individual Units" view. "Individual Units" shows all their units and allows them to add, remove, or edit units. "Unit Types" shows a summary table based on unit type.

NOTE: This is not a complete feature. Editing the summary table is not possible.
Type of change

[ ] 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)
[x] Prototype/POC (not to merge)
[ ] This change is a refactor/address technical debt
[ ] This change requires a documentation update
[ ] This change requires a SQL Script

How Can This Be Tested/Reviewed?
In the partner portal, edit a listing and toggle between "Unit Types" and "Individual Units"

[x] Desktop View
[x] Mobile View

Checklist:

[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my own code
[ ] I have reviewed the changes in a desktop view
[ ] I have reviewed the changes in a mobile view
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules
[ ] I have assigned reviewers
[ ] I have updated the changelog to include a description of my changes

I wasn't planning on submitting this, I thought I could send screenshots to Safiya that she could show during the property manager meeting. But still wanted to get some eyes on it, I can submit if you think it's useful.

There's a bug in the non-admin property listing page that causes this feature to not work for non-admins. I'll file a ticket for that soon.


Submitting HSMDinamo 4.10.1

Checklist for Pull Requests

[x] Have you signed the Contributor License Agreement?
[x] Is there a linked Issue?

Manifests

[x] Have you checked that there aren't other open pull requests for the same manifest update/change?
[x] This PR only modifies one (1) manifest
[x] Have you validated your manifest locally with winget validate --manifest <path>?

[x] Does your manifest conform to the 1.6 schema?

Note: <path> is the name of the directory containing the manifest you're submitting.

Microsoft Reviewers: Open in CodeFlow

@microsoft-github-policy-service agree [company="DinamoNetworks"]

@microsoft-github-policy-service agree

Verify:


Thoughts on standardizing contributions and expanding docs

Would it be possible to standardize the contribution guidelines. Things like branch naming conventions, commit names. Essentially just making a CONTRIBUTIONS.md and some kind of use documentation for the use of the implemented methods. I have a few ideas but I wanted to see what peoples thoughts were on opening a pr for that.

I think that adding a CONTRIBUTIONS.md is a great idea.  Would you be okay with doing an initial skeleton and we can help fill in the gaps?  It doesn't have to be perfect, we could evolve it over time.

Sounds good, I'll open a pr for it later tonight.


Assert::isNonEmptyList should result in non-empty-list

Currently it results in array.
Example
function foo(array $input) {
    Assert::isNonEmptyList($input);
    Assert::allString($input);
    \PHPStan\dumpType($input);
}

function bar(array $input) {
    Assert::isList($input);
    Assert::allString($input);
    \PHPStan\dumpType($input);
}

Output
Dumped type: array<string>
Dumped type: array<string>

Expected output
Dumped type: non-empty-list<string>
Dumped type: list<string>

I guess the list type in general is not implemented here.

List type isn't yet recognized and supported by PHPStan.

Ups, I thought this is something I can contribute.. Wasn't aware of that as it supports  it already via phpdoc :)

Yeah but it's currently interpreted as array<int, X>, which you can verify with \PHPStan\dumpType().
It's useful to keep this open once the full support lands.


Does FoldingCell work with reordering and deleting cells?

I have a task list app that I want to implement folding cells into, but I want to make sure that cell folding behavior will still be as expected after deleting and reordering cells in the table view.

@Reservations sorry for the delay. Developers was so busy and they missed a lot of issues here.
Reordering table view cells is supported by default. Additionally to standard reordering you'll need to reorder values in cellHeights array accordingly to your changes.
I think there is no issue for you anymore, but maybe somebody find this helpful.


Can I spawn a opbject by existed model.sdf instead of a hard_code streamstring

Hello
The cube_spawner spawn a cube by hard-code stringstream. Is there a way to use an existed model.xml file.
I tried to spawn my model by the way below, as you can see, I transfer the model.xml to the stringstream s instead of hard-code.
    std::ifstream xml_file;
    xml_file.open(xml_path,std::ios::in);
    if(!xml_file)
        std::cerr<<"can't find xml file: "<<xml_path<<std::endl;
    std::stringstream s;
    s<<xml_file.rdbuf();

But the model can't spawn normally. I use the rosrun command, the model can spawn normally.
rosrun gazebo_ros spawn_model -file `rospack find object_description`/urdf/banana.xml -urdf -y 1 -model banana

Try something like:

std::ifstream file("/path2/model.sdf");
gazebo_msgs::SpawnModel model;

if (file.is_open()) {
	std::string line;
	while (std::getline(file, line)) {
                   model.request.model_xml+=line;
	}
	file.close();
}

model.request.model_name="YourOwnModel";
model.request.initial_pose.position.x = 4;
model.request.initial_pose.position.y = 4;
model.request.initial_pose.position.z = 4;
client_spwn.call(model);

@matbol I test your code, but there is no model occur in gazebo.
        std::ifstream file;
        file.open(path);
        if(!file){
            std::cout<<"can't open "<<path<<std::endl;
            exit(-1);
        }
        gazebo_msgs::SpawnModel model;
        ros::ServiceClient client_spwn = nh.serviceClient< gazebo_msgs::SpawnModel> ("/gazebo/spawn_urdf_model");
        if (file.is_open()) {
            std::string line;
            while (std::getline(file, line)) {
                model.request.model_xml+=line;
            }
            file.close();
        }

        model.request.model_name = model_name;
        model.request.initial_pose.position.x = 4;
        model.request.initial_pose.position.y = 4;
        model.request.initial_pose.position.z = 4;
        client_spwn.call(model);

The model file is here.
Coud you please provide some advice? Thanks a lot!

Instead
ros::ServiceClient client_spwn = nh.serviceClient< gazebo_msgs::SpawnModel> ("/gazebo/spawn_urdf_model");
use
ros::ServiceClient client_spwn = nh.serviceClient< gazebo_msgs::SpawnModel> ("/gazebo/spawn_sdf_model");
for .sdf files.

Closing due to inactivity. Does anyone still need help with this? Then please re-open.


Fix postal code exceptions causing VAT to be zero-rated.

Fixes #30, by returning the default rate after checking for post code exceptions.

Thank you!

Current coverage is 96.68% (diff: 100%)

Merging #32 into master will increase coverage by 1.10%

@@             master        #32   diff @@
==========================================
  Files             5          5
  Lines           181        181
  Methods          35         35
  Messages          0          0
  Branches          0          0
==========================================
+ Hits            173        175     +2
+ Misses            8          6     -2
  Partials          0          0

Powered by Codecov. Last update e17b3fe...5c6d1f0


package_managers.py uses ET.ElementTree against untrusted data

The python docs mention:

Warning
The xml.etree.ElementTree module is not secure against maliciously constructed data. If you need to parse untrusted or unauthenticated data see XML vulnerabilities.

This is used in line 265 here:
https://github.com/nexB/vulnerablecode/blob/369897fb947584e44581df075c6e76638737f2ca/vulnerabilities/package_managers.py#L250-L266
The docs further suggest to use defusedxml instead:

defusedxml is a pure Python package with modified subclasses of all stdlib XML parsers that prevent any potentially malicious operation. Use of this package is recommended for any server code that parses untrusted XML data. The package also ships with example exploits and extended documentation on more XML exploits such as XPath injection.

Just realized a lot of importers also use ElementTree. Imo, all of them need to be refactored, importer data is certainly not trusted data.

Here's quick grep of the importers using ElementTree
vulnerabilities/data_source.py:import xml.etree.ElementTree as ET
vulnerabilities/data_source.py:    def _fetch(self) -> Tuple[Mapping, Iterable[ET.ElementTree]]:
vulnerabilities/data_source.py:        Return a two-tuple of ({mapping of Package URL data}, it's ET.ElementTree)
vulnerabilities/data_source.py:    def get_data_from_xml_doc(self, xml_doc: ET.ElementTree, pkg_metadata={}) -> List[Advisory]:
vulnerabilities/data_source.py:        OVAL xml ElementTree into a list of `Advisory`.
vulnerabilities/importers/debian_oval.py:import xml.etree.ElementTree as ET
vulnerabilities/importers/debian_oval.py:                ET.ElementTree(ET.fromstring(resp.decode("utf-8"))),
vulnerabilities/importers/gentoo.py:import xml.etree.ElementTree as ET
vulnerabilities/importers/openssl.py:import xml.etree.ElementTree as ET
vulnerabilities/importers/ubuntu.py:import xml.etree.ElementTree as ET
vulnerabilities/importers/ubuntu.py:                ET.ElementTree(ET.fromstring(extracted.decode("utf-8"))),
vulnerabilities/lib_oval.py:    >>> tree = ElementTree()
vulnerabilities/lib_oval.py:    >>> tree = ElementTree()
vulnerabilities/lib_oval.py:from xml.etree import ElementTree
vulnerabilities/lib_oval.py:from xml.etree.ElementTree import Element
vulnerabilities/lib_oval.py:        #         if not tree or not isinstance(tree, ElementTree):
vulnerabilities/lib_oval.py:            self.tree = ElementTree.ElementTree(root)
vulnerabilities/lib_oval.py:        Load an OVAL document from a filename and parse that into an ElementTree
vulnerabilities/lib_oval.py:                self.tree = ElementTree.parse(filename)
vulnerabilities/lib_oval.py:        Initializes the ElementTree by parsing the xmltext as XML
vulnerabilities/lib_oval.py:                root = ElementTree.fromstring(xmltext)
vulnerabilities/lib_oval.py:                self.tree = ElementTree(root)
vulnerabilities/lib_oval.py:        return ElementTree.tostring(root, "UTF-8", "xml").decode("utf-8")
vulnerabilities/lib_oval.py:        in the OVAL ElementTree.
vulnerabilities/lib_oval.py:        or None if there is no ElementTree or if a matching item could not be found
vulnerabilities/lib_oval.py:        Adds the element to the ElementTree for this OVAL document
vulnerabilities/lib_oval.py:        if the ElementTree does not already contain it.
vulnerabilities/lib_oval.py:        Get the raw xml.etree.ElementTree.Element for this node.  Can be used to directly manipulate the
vulnerabilities/lib_oval.py:            xml.etree.ElementTree.register_namespace("", namespace)
vulnerabilities/lib_oval.py:            xml.etree.ElementTree.register_namespace(
vulnerabilities/lib_oval.py:            xml.etree.ElementTree.register_namespace(
vulnerabilities/lib_oval.py:            xml.etree.ElementTree.register_namespace(
vulnerabilities/lib_oval.py:            # Create a new ElementTree with this element as the root
vulnerabilities/lib_oval.py:            tree = ElementTree(e)
vulnerabilities/lib_oval.py:            tree = ElementTree.ElementTree()
vulnerabilities/oval_parser.py:import xml.etree.ElementTree as ET
vulnerabilities/oval_parser.py:    def __init__(self, translations: Dict, oval_document: ET.ElementTree):
vulnerabilities/package_managers.py:import xml.etree.ElementTree as ET
vulnerabilities/package_managers.py:        xml_resp = ET.ElementTree(ET.fromstring(resp.decode("utf-8")))
vulnerabilities/package_managers.py:    def extract_versions(xml_response: ET.ElementTree) -> Set[str]:
vulnerabilities/tests/test_data_source.py:import xml.etree.ElementTree as ET
vulnerabilities/tests/test_debian_oval.py:import xml.etree.ElementTree as ET
vulnerabilities/tests/test_gentoo.py:import xml.etree.ElementTree as ET
vulnerabilities/tests/test_package_managers.py:import xml.etree.ElementTree as ET
vulnerabilities/tests/test_suse.py:import xml.etree.ElementTree as ET
vulnerabilities/tests/test_ubuntu.py:import xml.etree.ElementTree as ET

This makes 100% sense! good catch

@Hritik14 do you mind to check (may with quick search) if there are other repos impacted?

@pombredanne I ran a quick test. Potentially following repos are affected:

fetchcode
pymaven
scancode-toolkit
vulnerablecode

Here's quick grep of the codebases using ElementTree
./fetchcode/src/fetchcode/vcs/pip/_internal/index/collector.py:    import xml.etree.ElementTree
./fetchcode/src/fetchcode/vcs/pip/_internal/index/collector.py:    HTMLElement = xml.etree.ElementTree.Element
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/__init__.py:          elementtree-like interface (known to work with ElementTree,
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/__init__.py:          cElementTree and lxml.etree).
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/__init__.py:        xml.etree.ElementTree or cElementTree (Currently applies to the "etree"
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:def getETreeBuilder(ElementTreeImplementation):
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:    ElementTree = ElementTreeImplementation
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:    ElementTreeCommentType = ElementTree.Comment("asd").tag
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:        """Given the particular ElementTree representation, this implementation,
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:            elif node.tag == ElementTreeCommentType:
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree_lxml.py:        # Create the root document and add the ElementTree to it
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/__init__.py:          ElementTree-like interface, defaulting to xml.etree.cElementTree if
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/__init__.py:          available and xml.etree.ElementTree if not.
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/__init__.py:        types). A module implementing the tree type e.g. xml.etree.ElementTree
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/__init__.py:        or xml.etree.cElementTree.
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:def getETreeBuilder(ElementTreeImplementation, fullTree=False):
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:    ElementTree = ElementTreeImplementation
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:    ElementTreeCommentType = ElementTree.Comment("asd").tag
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            self._element = ElementTree.Element(self._getETreeTag(name,
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            self._element = ElementTree.Comment(data)
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            elif element.tag == ElementTreeCommentType:
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            if isinstance(element, ElementTree.ElementTree):
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            elif element.tag == ElementTreeCommentType:
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:        implementation = ElementTreeImplementation
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/_utils.py:    import xml.etree.cElementTree as default_etree
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/_utils.py:    import xml.etree.ElementTree as default_etree
./vulnerablecode/vulnerabilities/importer.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/importer.py:    def _fetch(self) -> Tuple[Mapping, Iterable[ET.ElementTree]]:
./vulnerablecode/vulnerabilities/importer.py:        Return a two-tuple of ({mapping of Package URL data}, it's ET.ElementTree)
./vulnerablecode/vulnerabilities/importer.py:        self, xml_doc: ET.ElementTree, pkg_metadata={}
./vulnerablecode/vulnerabilities/importer.py:        OVAL xml ElementTree into a list of `Advisory`.
./vulnerablecode/vulnerabilities/importers/openssl.py:import defusedxml.ElementTree as DET
./vulnerablecode/vulnerabilities/importers/gentoo.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/importers/debian_oval.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/importers/debian_oval.py:                ET.ElementTree(ET.fromstring(resp.decode("utf-8"))),
./vulnerablecode/vulnerabilities/importers/ubuntu.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/importers/ubuntu.py:                ET.ElementTree(ET.fromstring(extracted.decode("utf-8"))),
./vulnerablecode/vulnerabilities/oval_parser.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/oval_parser.py:    def __init__(self, translations: Dict, oval_document: ET.ElementTree):
./vulnerablecode/vulnerabilities/tests/test_openssl.py:import defusedxml.ElementTree as DET
./vulnerablecode/vulnerabilities/tests/test_suse.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/tests/test_debian_oval.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/tests/test_data_source.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/tests/test_package_managers.py:        import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/tests/test_ubuntu.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/tests/test_gentoo.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/lib_oval.py:    >>> tree = ElementTree()
./vulnerablecode/vulnerabilities/lib_oval.py:    >>> tree = ElementTree()
./vulnerablecode/vulnerabilities/lib_oval.py:from xml.etree import ElementTree
./vulnerablecode/vulnerabilities/lib_oval.py:from xml.etree.ElementTree import Element
./vulnerablecode/vulnerabilities/lib_oval.py:        #         if not tree or not isinstance(tree, ElementTree):
./vulnerablecode/vulnerabilities/lib_oval.py:            self.tree = ElementTree.ElementTree(root)
./vulnerablecode/vulnerabilities/lib_oval.py:        Load an OVAL document from a filename and parse that into an ElementTree
./vulnerablecode/vulnerabilities/lib_oval.py:                self.tree = ElementTree.parse(filename)
./vulnerablecode/vulnerabilities/lib_oval.py:        Initializes the ElementTree by parsing the xmltext as XML
./vulnerablecode/vulnerabilities/lib_oval.py:                root = ElementTree.fromstring(xmltext)
./vulnerablecode/vulnerabilities/lib_oval.py:                self.tree = ElementTree(root)
./vulnerablecode/vulnerabilities/lib_oval.py:        return ElementTree.tostring(root, "UTF-8", "xml").decode("utf-8")
./vulnerablecode/vulnerabilities/lib_oval.py:        in the OVAL ElementTree.
./vulnerablecode/vulnerabilities/lib_oval.py:        or None if there is no ElementTree or if a matching item could not be found
./vulnerablecode/vulnerabilities/lib_oval.py:        Adds the element to the ElementTree for this OVAL document
./vulnerablecode/vulnerabilities/lib_oval.py:        if the ElementTree does not already contain it.
./vulnerablecode/vulnerabilities/lib_oval.py:        Get the raw xml.etree.ElementTree.Element for this node.  Can be used to directly manipulate the
./vulnerablecode/vulnerabilities/lib_oval.py:            xml.etree.ElementTree.register_namespace("", namespace)
./vulnerablecode/vulnerabilities/lib_oval.py:            xml.etree.ElementTree.register_namespace(
./vulnerablecode/vulnerabilities/lib_oval.py:            xml.etree.ElementTree.register_namespace(
./vulnerablecode/vulnerabilities/lib_oval.py:            xml.etree.ElementTree.register_namespace(
./vulnerablecode/vulnerabilities/lib_oval.py:            # Create a new ElementTree with this element as the root
./vulnerablecode/vulnerabilities/lib_oval.py:            tree = ElementTree(e)
./vulnerablecode/vulnerabilities/lib_oval.py:            tree = ElementTree.ElementTree()
./vulnerablecode/vulnerabilities/package_managers.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/package_managers.py:            xml_resp = ET.ElementTree(ET.fromstring(response.decode("utf-8")))
./vulnerablecode/vulnerabilities/package_managers.py:    def extract_versions(xml_response: ET.ElementTree) -> Iterable[PackageVersion]:
./pymaven/pymaven/client.py:    from xml.etree import cElementTree as ElementTree
./pymaven/pymaven/client.py:    from xml.etree import ElementTree
./pymaven/pymaven/client.py:            metadata = ElementTree.parse(fh)
./scancode-toolkit/tests/licensedcode/data/datadriven/external/fossology-tests/BSD/__init__.py:   pre-processed text into an ElementTree.
./scancode-toolkit/tests/licensedcode/data/datadriven/external/fossology-tests/BSD/__init__.py:3.  One such
./scancode-toolkit/tests/licensedcode/data/datadriven/external/fossology-tests/BSD/__init__.py:   treeprocessor runs InlinePatterns against the ElementTree, detecting inline
./scancode-toolkit/tests/licensedcode/data/datadriven/external/fossology-tests/BSD/__init__.py:4. Some post-processors are run against the text after the ElementTree has
./scancode-toolkit/tests/cluecode/data/ics/markdown-markdown/html4.py:# Taken from ElementTree 1.3 preview with slight modifications
./scancode-toolkit/tests/cluecode/data/ics/markdown-markdown/html4.py:# The ElementTree toolkit is

Here's a better grep with tests excluded.
Following repos are affected:

fetchcode
pymaven
vulnerablecode

Here's quick grep of the codebases using ElementTree
./fetchcode/src/fetchcode/vcs/pip/_internal/index/collector.py:    import xml.etree.ElementTree
./fetchcode/src/fetchcode/vcs/pip/_internal/index/collector.py:    HTMLElement = xml.etree.ElementTree.Element
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/__init__.py:          elementtree-like interface (known to work with ElementTree,
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/__init__.py:          cElementTree and lxml.etree).
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/__init__.py:        xml.etree.ElementTree or cElementTree (Currently applies to the "etree"
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:def getETreeBuilder(ElementTreeImplementation):
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:    ElementTree = ElementTreeImplementation
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:    ElementTreeCommentType = ElementTree.Comment("asd").tag
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:        """Given the particular ElementTree representation, this implementation,
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treewalkers/etree.py:            elif node.tag == ElementTreeCommentType:
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree_lxml.py:        # Create the root document and add the ElementTree to it
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/__init__.py:          ElementTree-like interface, defaulting to xml.etree.cElementTree if
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/__init__.py:          available and xml.etree.ElementTree if not.
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/__init__.py:        types). A module implementing the tree type e.g. xml.etree.ElementTree
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/__init__.py:        or xml.etree.cElementTree.
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:def getETreeBuilder(ElementTreeImplementation, fullTree=False):
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:    ElementTree = ElementTreeImplementation
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:    ElementTreeCommentType = ElementTree.Comment("asd").tag
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            self._element = ElementTree.Element(self._getETreeTag(name,
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            self._element = ElementTree.Comment(data)
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            elif element.tag == ElementTreeCommentType:
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            if isinstance(element, ElementTree.ElementTree):
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:            elif element.tag == ElementTreeCommentType:
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/treebuilders/etree.py:        implementation = ElementTreeImplementation
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/_utils.py:    import xml.etree.cElementTree as default_etree
./fetchcode/src/fetchcode/vcs/pip/_vendor/html5lib/_utils.py:    import xml.etree.ElementTree as default_etree
./vulnerablecode/vulnerabilities/importer.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/importer.py:    def _fetch(self) -> Tuple[Mapping, Iterable[ET.ElementTree]]:
./vulnerablecode/vulnerabilities/importer.py:        Return a two-tuple of ({mapping of Package URL data}, it's ET.ElementTree)
./vulnerablecode/vulnerabilities/importer.py:        self, xml_doc: ET.ElementTree, pkg_metadata={}
./vulnerablecode/vulnerabilities/importer.py:        OVAL xml ElementTree into a list of `Advisory`.
./vulnerablecode/vulnerabilities/importers/openssl.py:import defusedxml.ElementTree as DET
./vulnerablecode/vulnerabilities/importers/gentoo.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/importers/debian_oval.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/importers/debian_oval.py:                ET.ElementTree(ET.fromstring(resp.decode("utf-8"))),
./vulnerablecode/vulnerabilities/importers/ubuntu.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/importers/ubuntu.py:                ET.ElementTree(ET.fromstring(extracted.decode("utf-8"))),
./vulnerablecode/vulnerabilities/oval_parser.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/oval_parser.py:    def __init__(self, translations: Dict, oval_document: ET.ElementTree):
./vulnerablecode/vulnerabilities/lib_oval.py:from xml.etree import ElementTree
./vulnerablecode/vulnerabilities/lib_oval.py:from xml.etree.ElementTree import Element
./vulnerablecode/vulnerabilities/package_managers.py:import xml.etree.ElementTree as ET
./vulnerablecode/vulnerabilities/package_managers.py:            xml_resp = ET.ElementTree(ET.fromstring(response.decode("utf-8")))
./vulnerablecode/vulnerabilities/package_managers.py:    def extract_versions(xml_response: ET.ElementTree) -> Iterable[PackageVersion]:
./pymaven/pymaven/client.py:    from xml.etree import cElementTree as ElementTree
./pymaven/pymaven/client.py:    from xml.etree import ElementTree
./pymaven/pymaven/client.py:            metadata = ElementTree.parse(fh)


PHP indentation within HTML files

This is somewhat messy with current sniffs, do we have some rule that we can test against and maybe edit sniffs to enforce it ?

I can't reproduce these anymore, and the upstream version of the ScopeIndent sniff is being used now instead (see #250). Closing.


Question: Pre-cached containers

Summary
In the original post, it is explained one of the benefits of custom AMIs is pre-cached containers.

Description

I'd like to pull some containers before the AMI finish its build process.
Two questions:

If I achieve this are those docker layers preserved in the generated AMI?
What's the best way to do this? I thought it might be easy to do as adding the commands in a file or creating a bash script but I couldn’t find any reference to this approach except for RMPS in additional-packages folder.

Expected Behavior
Observed Behavior
Environment Details

Supporting Log Snippets

Hi @oscarnevarezleal ,

Yeah, everything you did in the AMI creation process should be kept unless removed specifically in https://github.com/aws/amazon-ecs-ami/blob/main/scripts/cleanup.sh
Since what you would like to do is to pull some container, what you mentioned (adding the commands in a file or creating a bash script) should work. Just need to make sure it is done after the container runtime is installed and enabled. You can see the order of script execution in files like https://github.com/aws/amazon-ecs-ami/blob/main/al2.pkr.hcl. Here, I think you can add the file/shell provisioner here. For how to use file/shell provisioner, you can find documentation here.

Please feel free to reopen if you need any more help!


[Strategy Suggestion] passport-pam

Found several node packages for PAM but would love to have PAM support for passport.

Me too, I would love to see Linux PAM supported as an authentication strategy. I see Windows authentication is supported.
This is one node PAM library which supports Linux PAM authentication
https://www.npmjs.com/package/node-linux-pam


LaravelNovaUi is not defined

Hello Sir
I faced this problem twice in an old and new project, which caused breaking Nova and showing a blank page.
"outl1ne/nova-settings": "^5.2",

Oooof, I think I released the wrong branch for Nova v4. :( Fixed now, same release number.


HTTP return code feature.

Dear Friend,
Would it be possible to implement the mapping of http codes for each query?
For example:

Its possible? As it currently only displays data that returns success, however when we have errors, only an error message is displayed on the panel.

Regards,

hi - Sorry missed the issue and sorry for the delay.
In recent versions (0.8.3+), You will see the error code in the message when the response code is not 200. Hope it helps. I don't think the plugin will be supporting the http response code as column anytime soon.


Extension prompts user to install formatter even after installing it

Change path to formatter such as black to xyz
"python.linting.blackPath": "xyz"
Extension will prompt user to install black
Click OK
You'll keep getting the same prompt

Problem:

We install black
But the name of the module executed is xyz

Suggestions:

Prompt user to change the path to black
Prompt to install xyz
Install black and update settings to point to black instead of xyz

Either suggestion 1 or 3.

I'll go with 1 as thats easier and this is an edge case.

Closing as we're not planning to do this for now.


Present the IBL data analysis paper

Hi @joacorapela ,  closing this as I've discussed with Goncalo, and Joseph and Thinh are aware. If you want to discuss this paper with me or in a group setting again just ping me


added support for python 3

@girishramnani the README instructions don't work with this branch.  g.inbox() results in None, but you can get it with g.mailbox(bytes('INBOX', 'ascii').  However, Mailbox.mail() produces the following error:
     68         if response == 'OK':
     69             # filter out empty strings
---> 70             uids = [_f for _f in data[0].split(' ') if _f]
     71
     72             for uid in uids:

TypeError: a bytes-like object is required, not 'str'

@girishramnani got it working on Python 3 here, but not very gracefully.  Perhaps there are enough bread crumbs to make your PR work?  :-)

will open a new PR after some refactors. :-)


ARTEMIS-3763 Use margin when checking time difference between broker and database

I created a new PR with the changes of #4017 and added them to the current release (2.25.0) because my previous PR did not receive any updates and we need this change to use artemis in production.
If you don't like these changes please let me know then I will look for another solution.
I also noticed that you are reworking the logging of the complete project. If you think it would be better to delay this PR until the new logging is fully implemented, I will wait. Just tell me your decision.

As in any feature, a test would be required to guarantee sustained quality of the feature.. not just for the current but also preventing someone from ever breaking it.

We would need at least a Mocking test validating it. a test with a real Database (we use Derby in a lot of tests) would be my preferred option.

Thanks for your reply @clebertsuconic. I will add some tests in the next few days.

@MM53 please, add some description on the JIRA about the feature and how you're testing it?

@clebertsuconic I wouldn't consider this change as a new feature. It just improves the logging of the existing JDBC-persistence by making two log lines more predictable than before. The concrete issue was discussed in #4017 and also shortly described in JIRA.
I only added a new optional configuration parameter which is used to decide when a warning log should be printed out. Therefore the only effect I could verify in a test is if this warning was printed. But I couldn't find any solution to observe the logs without using some crazy reflections which will definitely break with some newer JDKs or without modifying the JdbcLeaseLock class to set a new LOGGER at runtime which doesn't seem to be a good idea either. To my mind the current tests are sufficient because they verify that artemis still starts even with the new configuration parameter. Existing logging also isn't tested at the moment.
If you have a better idea, please let me know. I am open to any suggestions.

@MM53 well, you're having to add configuration, it makes it a feature...
You don't know me personally but between bug and feature it's usually a relative concept.. even in real life...
Bug: Stuff is not working
Feature: Stuff is not implemented.
it's just a wording difference.
Anyway, regardless, please add some detail to the JIRA on what you're changing, and why please.

Whats difference of this and same named PR? https://github.com/apache/activemq-artemis/pull/4017?
If no difference then please check all previous points in other pr are addressed

Have points raised in 4017 been addressed in this PR?

Yes, all suggestions of 4017 were also added to this one

@MM53 I'm running the entire set of tests on this branch.. if all good I will merge it...
this is just about logging a warn only if the things is outside of a configured window, right?
let me run it and I will merge it..
(I may change the .warn to use the Logging code though).

@MM53 instead of asking you do perform a few changes, I am doing the simple changes I was going to ask you to do, and I'm amending them as you.. you still get authorship on the git logs.. (It was just easier to do it that way).
Please take a look on the final result of the commit. look at what I did on the test where I made the class non final, and made the test to return a fake time.
I had to do this because your test was not actually failing. The assertion was passing for something else. I made usage of the AssertionLoggerHandler where we use it in a few other tests.


number pad issues

When Num Lock is off, the keys are supposed to function to left, right, up or down. But they aren't working.

Fixed by #1188.

It not work also for me now.

It's fixed on dev branch. You could take this build to test: https://github.com/Genymobile/scrcpy/issues/898#issuecomment-610932491

Ty.
dev branch is accessible via Github?

The take these binaries: https://github.com/Genymobile/scrcpy/issues/898#issuecomment-610932491

I test dev binaries but key pad not work again.

@KIMYONGUP Could you test, please?


Update brew commands

Description

Related issue and scope

[ ] I opened an issue to propose and discuss this change (#????)

My changes affect the following components

[ ] API
[ ] Controller
[ ] Message Bus (e.g., Kafka)
[ ] Loadbalancer
[ ] Invoker
[ ] Intrinsic actions (e.g., sequences, conductors)
[ ] Data stores (e.g., CouchDB)
[ ] Tests
[ ] Deployment
[ ] CLI
[ ] General tooling
[x] Documentation

Types of changes

[x] Bug fix (generally a non-breaking change which closes an issue).
[ ] Enhancement or new feature (adds new functionality).
[ ] Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

[x] I signed an Apache CLA.
[x] I reviewed the style guides and followed the recommendations (Travis CI will check :).
[ ] I added tests to cover my changes.
[ ] My changes require further changes to the documentation.
[x] I updated the documentation where necessary.

Codecov Report

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

@@             Coverage Diff             @@
##           master    #4823       +/-   ##
===========================================
+ Coverage   43.84%   78.27%   +34.42%
===========================================
  Files         197      197
  Lines        8879     8879
  Branches      607      607
===========================================
+ Hits         3893     6950     +3057
+ Misses       4986     1929     -3057

Impacted Files
Coverage Δ

...che/openwhisk/core/invoker/LogStoreCollector.scala
100% <0%> (ø)
:arrow_up:

...la/org/apache/openwhisk/http/BasicRasService.scala
100% <0%> (ø)
:arrow_up:

.../apache/openwhisk/core/controller/Controller.scala
84.21% <0%> (ø)
:arrow_up:

...a/org/apache/openwhisk/http/BasicHttpService.scala
93.22% <0%> (+11.86%)
:arrow_up:

...la/org/apache/openwhisk/core/invoker/Invoker.scala
71.66% <0%> (ø)
:arrow_up:

...nwhisk/core/database/RemoteCacheInvalidation.scala
80% <0%> (ø)
:arrow_up:

...pache/openwhisk/core/invoker/InvokerReactive.scala
79.82% <0%> (+20.17%)
:arrow_up:

...he/openwhisk/core/invoker/MessagingActiveAck.scala
53.84% <0%> (ø)
:arrow_up:

...che/openwhisk/core/loadBalancer/LoadBalancer.scala
83.33% <0%> (+16.66%)
:arrow_up:

...whisk/connector/kafka/KafkaMessagingProvider.scala
70.73% <0%> (ø)
:arrow_up:

... and 135 more

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 2dbdca8...f59be07. Read the comment docs.


[tests] Add precommit hook with black

First steps towards adopting black !
The idea is to gain time and energy :

No need to think about code style when writing
No need to worry about code style when reviewing (huge loss of time)
Easier for new comers to open their PRs

For now, we'll stick with 120 line length, but we'll probably move to 100 afterwards.
Also need to add flake8 but I don't know it much yet.
Resources

Django adopting black: see the end for the procedure we'll follow
Why prettier in JS: good read.
Linus about line length.

Nice!
Why no string normalization?

It'll probably come when we apply black to the whole codebase.
For now, two many quotes are single (and I like them better but I should adhere to black..) to enforce double quote now.

In my opinion changing some style settings of a standardized formatted defeats the purpose (of not having to make any choices). Unless there is no technical reason to not go with the default settings I personally would simply go with the default settings.

I add string normalization in the next PR that does the black formatting.
However, I think I'll keep line length to 100 instead of 88. I don't see the point of 88 now that Github shows up to 120 chars without scrolling.

Agreed!


Automatically list all members of accessor?

Is there a way to avoid having to list all the members of the accessor? Possibly specifying  a class which is returned by the accessor?
(e.g.: https://opendrift.github.io/trajan/api.html#methods)

not that I know of, and this would be tricky to support either way: I don't know of a reliable way to classify the different items as methods and attributes (__call__ / __getitem__ will always require special attention), and even more so if you have nested accessors, with the second one being callable (ds.accessor1.accessor2()).
I'm happy to be proven wrong, but for now I believe the explicit choice of the documentation method is a good thing.


Table tenis

PR Description 📜
Summary
In this PR, I addressed the following issues:
1.Implemented a point-based scoring system where the game ends when a player reaches 11 points.
2.Added a function to declare the winner and reset the game.
3.Adjusted ball speed and direction for more accurate and dynamic gameplay.
4.Provided a brief description of the changes made in the code.
PR Description
Fixes #3248
This PR enhances the table tennis game by introducing a point-based scoring system. The game now ends when a player scores 11 points. Additionally, the code has been optimized to improve the accuracy and dynamics of ball movement. A function has been added to declare the winner and reset the game when the winning condition is met.

Mark the task you have completed ✅

[x] I follow CONTRIBUTING GUIDELINE & CODE OF CONDUCT of this project.
[x] I have performed a self-review of my own code or work.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] My changes generates no new warnings.
[x] I have followed proper naming convention showed in CONTRIBUTING GUIDELINE
[x] I have added screenshot for website preview in assets/images
[x] I have added entries for my game in main README.md
[x] I have added README.md in my folder
[ ] I have added working video of the game in README.md (optional)
[x] I have specified the respective issue number for which I have requested the new game.

Add your screenshots(Optional) 📸

Thank you soo much for contributing to our repository 💗

Thank you @jayesh2474 ,for creating the PR and contributing to our GameZone 💗
Review team will review the PR and will reach out to you soon! 😇
Make sure that you have marked all the tasks that you are done with ✅.
Thank you for your patience! 😀

Game added kindly merge PR

@jayesh2474 follow proper guidelines and then make your PR again !
would recommend you to go through whole process of contribution !


NullPointerException when natives mapping for libraries is incomplete

This manifests in the following stacktrace:
java.lang.NullPointerException
 	at link.infra.jumploader.resolution.sources.MinecraftJarSource.lambda$resolve$0(MinecraftJarSource.java:162)
 	at link.infra.jumploader.resolution.sources.MetadataCacheHelper$MetadataCacheView.lambda$getObject$1(MetadataCacheHelper.java:59)
 	at link.infra.jumploader.resolution.sources.MetadataCacheHelper$MetadataCacheView.lambda$getAsString$0(MetadataCacheHelper.java:55)
 	at link.infra.jumploader.resolution.sources.MetadataCacheHelper$MetadataCacheView.getAsBytes(MetadataCacheHelper.java:48)
 	at link.infra.jumploader.resolution.sources.MetadataCacheHelper$MetadataCacheView.getAsString(MetadataCacheHelper.java:55)
 	at link.infra.jumploader.resolution.sources.MetadataCacheHelper$MetadataCacheView.getObject(MetadataCacheHelper.java:59)
 	at link.infra.jumploader.resolution.sources.MinecraftJarSource.resolve(MinecraftJarSource.java:117)
 	at link.infra.jumploader.resolution.ResolutionProcessor.doMetaResolve(ResolutionProcessor.java:40)
 	at link.infra.jumploader.resolution.ResolutionProcessor.processMetadata(ResolutionProcessor.java:33)
 	at link.infra.jumploader.Jumploader.onLoad(Jumploader.java:100)

This was observed trying to load Minecraft 1.16.1 on OSX, and did not appear on Linux. I'm not sure at this time which library generated the error in particular. We were using the All Of Fabric 3 modpack with version 1.5.1. Jumploader 2.0.0 seems to have been in AoF3 since 1.4.0
Since at least Minecraft 1.12, the natives object only has mappings for OS names that are referenced in the rule set or classifiers. For example, 1.12.json includes this library definition:
{
    "downloads": {
      "artifact": {
        "path": "ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.jar",
        "sha1": "6ef160c3133a78de015830860197602ca1c855d3",
        "size": 40502,
        "url": "https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.jar"
      },
      "classifiers": {
        "javadoc": {
          "path": "ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0-javadoc.jar",
          "sha1": "fb0092f22cb4fe8e631452f577b7a238778abf2a",
          "size": 174060,
          "url": "https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0-javadoc.jar"
        },
        "natives-osx": {
          "path": "ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0-natives-osx.jar",
          "sha1": "08befab4894d55875f33c3d300f4f71e6e828f64",
          "size": 5629,
          "url": "https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0-natives-osx.jar"
        },
        "sources": {
          "path": "ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0-sources.jar",
          "sha1": "865837a198189aee737019561ece842827f24278",
          "size": 43283,
          "url": "https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0-sources.jar"
        }
      }
    },
    "extract": {
      "exclude": [
        "META-INF/"
      ]
    },
    "name": "ca.weblite:java-objc-bridge:1.0.0",
    "natives": {
      "osx": "natives-osx"
    },
    "rules": [
      {
        "action": "allow",
        "os": {
          "name": "osx"
        }
      }
    ]
  },

The line with the NPE in particular is where this natives object is queried for the current OS whenever the natives object is defined: https://github.com/comp500/Jumploader/blob/4c6de885cd93f9ae83305968148ad4273fc25f04/src/main/java/link/infra/jumploader/resolution/sources/MinecraftJarSource.java#L160-L162
However, if the object does not contain a mapping for the current OS (in the case of a partial mapping in >=1.12), this generates an NPE. Instead of an NPE, the launch should continue without the library; Since there is no mapping for the current OS, the library shouldn't be downloaded anyway.

Shouldn't the ruleset exclude libraries that don't have any native mappings for the current OS? If you can find which library causes this issue that'd be really helpful.
Thanks for the PR (I'll have another look through it tomorrow) although I might remove downloading natives entirely for now - due to https://github.com/comp500/Jumploader/wiki/Possible-future-changes-and-improvements#native-libraries Jumploader currently uses the native libraries supplied by the launcher anyway.

Shouldn't the ruleset exclude libraries that don't have any native mappings for the current OS?

It appears that some of the libraries are default-allow, and then specifically exclude OSX. I think this causes the rule checking to see the "allow everyone" rule and break early, before parsing the "disallow OSX" rule. One example I picked at random is lwjgl-stb:
    "name": "org.lwjgl:lwjgl-stb:3.2.2",
    "natives": {
      "linux": "natives-linux",
      "windows": "natives-windows"
    },
    "rules": [
      {
        "action": "allow"
      },
      {
        "action": "disallow",
        "os": {
          "name": "osx"
        }
      }
    ]

I found this (and 7 other libraries) with:
curl http://launchermeta.mojang.com/v1/packages/0c127f291db55d4a09830a3891c5447e63714d92/1.16.1.json | jq ".libraries|map(select(.natives and .natives.osx == null and .rules ))"

I think either one of these PRs would prevent the NPE, but perhaps fixing the rules engine is the "more correct" solution which addresses the problem instead of the symptom.

Rule evaluation happens in reverse, so that shouldn't cause an issue. I checked with a debugger, and the NPE actually seems to occur with the following library:
{
    "downloads": {
        "artifact": {
            "path": "com/mojang/text2speech/1.11.3/text2speech-1.11.3.jar",
            "sha1": "f378f889797edd7df8d32272c06ca80a1b6b0f58",
            "size": 13164,
            "url": "https://libraries.minecraft.net/com/mojang/text2speech/1.11.3/text2speech-1.11.3.jar"
        },
        "classifiers": {
            "natives-linux": {
                "path": "com/mojang/text2speech/1.11.3/text2speech-1.11.3-natives-linux.jar",
                "sha1": "ac641755a2a841d1fca9e660194f42523ee5cfe0",
                "size": 7833,
                "url": "https://libraries.minecraft.net/com/mojang/text2speech/1.11.3/text2speech-1.11.3-natives-linux.jar"
            },
            "natives-windows": {
                "path": "com/mojang/text2speech/1.11.3/text2speech-1.11.3-natives-windows.jar",
                "sha1": "c0b242c0091be5acbf303263c7eeeaedd70544c7",
                "size": 81379,
                "url": "https://libraries.minecraft.net/com/mojang/text2speech/1.11.3/text2speech-1.11.3-natives-windows.jar"
            },
            "sources": {
                "path": "com/mojang/text2speech/1.11.3/text2speech-1.11.3-sources.jar",
                "sha1": "772a37dd77417571e6f119a8d306f0c14c2ee410",
                "size": 5332,
                "url": "https://libraries.minecraft.net/com/mojang/text2speech/1.11.3/text2speech-1.11.3-sources.jar"
            }
        }
    },
    "extract": {
        "exclude": ["META-INF/"]
    },
    "name": "com.mojang:text2speech:1.11.3",
    "natives": {
        "linux": "natives-linux",
        "windows": "natives-windows"
    }
}

I'm still curious as to what the launcher does on macOS (I'll have a look at how MultiMC handles it) but it seems that your first PR would be the correct solution for this.


Codelens shows wrong signature when switching files

For soothsayer I recorded this gif which shows the issue:

memoization issue?  Looks like the sigs from the first file are shown on the seconds, indeantion looks out too.

duplicated https://github.com/ionide/ionide-vscode-fsharp/issues/257

https://github.com/ionide/ionide-vscode-fsharp/blob/master/src/Components/CodeLens.fs#L14 :))))

Fixed in https://github.com/ionide/ionide-vscode-fsharp/pull/259

Released in 2.8.9

The wrong signatures are no longer show, instead I get no signatures for the second file...


[HelpNeeded][Theming] When primary is green, Typography in AppBar is black

Hi,
I understand I'm doing something silly, but I've been playing around for a while and am unsure what the canonical way is to get this to work.
Specifically, I have a simple AppBar:
      <MuiThemeProvider theme={theme}>
        <AppBar position="fixed">
          <Toolbar>
            <Typography type="headline">
              Dashboard
            </Typography>
          </Toolbar>
        </AppBar>
      </MuiThemeProvider>

I have also changed my theme such that primary is green:
const theme = createMuiTheme({
  palette: {
    primary: green
  },
});

The result is the rendered text is black, which seems to make sense after reading through the themes documentation and createMuiTheme.js.
My question is really what would be the canonical way to make all text in the theme white if the background is green (primary)? I appreciate the help.
material-ui version: 1.0.0-beta.22

My question is really what would be the canonical way to make all text in the theme white if the background is green (primary)?

Yes, you can customize the getContrastText function to change the text color.


TensorRT MobileNet benchmark results

I am curious about how you implement depthwise plugin layer in TRT by yourselves? The MobileNet v1, v2 test results do not make sense to me. Why so little latency difference between batchsize=1 and 2?

Any update on this?

we will update benchmark with tensorrt4.0 soon

@LittleMaer Interesting... why are we closing the issue?
I have viewed the recent update, didn't have benchmark update with TensorRT4.0.
And that's also not direct related to the topic =>" how you implement depthwise plugin layer in TRT by yourselves? "


Broken link in Script stage setup documentation

Issue Summary:
In the setup instructions for the Script stage, the URL https://storage.googleapis.com/jenkins-script-stage-config/scriptJobConfig.xml is broken
Cloud Provider(s):
n/a
Environment:
n/a
Feature Area:
Documentation
Steps to Reproduce:
curl https://storage.googleapis.com/jenkins-script-stage-config/scriptJobConfig.xml
Additional Details:
In addition, the reference to orca-local.yml is unclear: My .hal directory has two files with this name.

@robzienert , do you know anything about the missing scriptJobConfig.xml?

Unfortunately, no. All of that predates me.

@spinnakerbot  remove-label stale

Dear @spinnakerbot  the issue is still present on spinnaker website.
Instead of marking it as stale, it would be super cool if you could use your amazing artificial intelligence to tag someone who knows where this script is and fix the link :smiley:

@spinnaker-bot add-label no-lifecycle


Python Fundamentals for Beginners

you have added different courses in different files , please updates in all files , also there is conflict , please create another pr


chore: minor fixes

format issue in #1225
profile in wrong place

__
  Summary: :hammer_and_wrench: This code needs a fix

I've cancelled the Update Prolfiles.md due it should trigger when merging into main branch