Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to graph nested serializable types #31

Merged
merged 3 commits into from
Nov 30, 2021

Conversation

saba-ja
Copy link
Contributor

@saba-ja saba-ja commented Sep 30, 2021

Originating Project/Creator F Prime GDS
Affected Component Charts
Affected Architectures(s) NA
Related Issue(s) NA
Has Unit Tests (y/n) No
Builds Without Errors (y/n) No
Unit Tests Pass (y/n) NA
Documentation Included (y/n) No

Change Description

Added option to graph serializable types.

Rationale

Nested serializable types now can be graphed. This PR adds an option to convert channel JSON path to a flat dot delimited string that user can select from the Charts dropdown. Only nested serializable types with a final single value are supported. Currently up to 20 nested depth will be covered. Array and array of serializable and Enum types will not show up in the Chart dropdown list.

Testing/Review Recommendations

Manually ran and verified in the Browser. See the screen recording below:
https://youtu.be/19h_SswEeFY

Future Work

NA

@github-actions
Copy link

github-actions bot commented Sep 30, 2021

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (140)
AF
am
an
as
at
av
Az
be
bg
BI
br
bs
by
bz
cc
cd
ch
co
cs
dd
de
di
dl
Dn
do
DP
ds
dt
DW
ec
ed
el
em
en
ep
eq
es
ex
fa
FF
fg
fi
fn
fp
FR
fs
fw
gd
go
gt
Ha
he
hi
hr
hs
Hz
I've
IB
id
IE
if
ii
in
io
is
it
IV
ja
js
Ki
La
lg
li
lo
ls
lt
mb
md
me
mf
mh
Mi
ml
mm
mp
mr
ms
mt
mw
my
na
nd
nl
no
of
ok
ol
on
op
or
os
ot
pi
pl
pr
ps
pt
qt
rc
re
rs
sf
sh
sm
so
SP
sr
ss
st
sw
tb
Te
th
TK
to
tr
ts
ui
un
up
us
UT
vs
wb
we
we're
ws
wy
xi
xs
Previously acknowledged words that are now absent css dts sss UIs
Available dictionaries could cover words not in the dictionary

cspell:cpp/cpp.txt (104293) covers 199 of them
cspell:css/css.txt (993) covers 64 of them
cspell:html/html.txt (542) covers 53 of them
cspell:filetypes/filetypes.txt (337) covers 53 of them
cspell:python/python.txt (364) covers 36 of them
cspell:django/django.txt (2342) covers 26 of them
cspell:golang/go.txt (7745) covers 21 of them
cspell:aws/aws.txt (1485) covers 18 of them
cspell:npm/npm.txt (671) covers 17 of them
cspell:fullstack/fullstack.txt (181) covers 14 of them
cspell:lua/lua.txt (391) covers 12 of them
cspell:csharp/csharp.txt (123) covers 10 of them
cspell:rust/rust.txt (112) covers 9 of them
cspell:java/java.txt (33524) covers 9 of them
cspell:ruby/ruby.txt (354) covers 7 of them
cspell:php/php.txt (9785) covers 7 of them
cspell:ada/ada.txt (72) covers 7 of them
cspell:haskell/haskell.txt (33) covers 5 of them
cspell:bash/bash-words.txt (22) covers 5 of them
cspell:scala/scala.txt (2752) covers 4 of them
cspell:dotnet/dotnet.txt (9824) covers 3 of them
cspell:node/node.txt (9611) covers 2 of them

Consider adding them using:

      with:
        extra_dictionaries:
          cspell:cpp/cpp.txt
          cspell:css/css.txt
          cspell:html/html.txt
          cspell:filetypes/filetypes.txt
          cspell:python/python.txt
          cspell:django/django.txt
          cspell:golang/go.txt
          cspell:aws/aws.txt
          cspell:npm/npm.txt
          cspell:fullstack/fullstack.txt
          cspell:lua/lua.txt
          cspell:csharp/csharp.txt
          cspell:rust/rust.txt
          cspell:java/java.txt
          cspell:ruby/ruby.txt
          cspell:php/php.txt
          cspell:ada/ada.txt
          cspell:haskell/haskell.txt
          cspell:bash/bash-words.txt
          cspell:scala/scala.txt
          cspell:dotnet/dotnet.txt
          cspell:node/node.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:saba-ja/fprime-gds.git repository
on the add_serializable_graph branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/fprime-community/fprime-gds/issues/comments/930874404" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u

@lgtm-com
Copy link

lgtm-com bot commented Sep 30, 2021

This pull request introduces 3 alerts when merging d78ac43 into c567e49 - view on LGTM.com

new alerts:

  • 1 for Unused loop iteration variable
  • 1 for Useless conditional
  • 1 for Unused variable, import, function or class

@saba-ja
Copy link
Contributor Author

saba-ja commented Sep 30, 2021

@LeStarch, I am not sure about these spell check errors. It seems the spell checker is confused and is picking up on too many words.

@LeStarch
Copy link
Collaborator

@saba-ja yes something appears wrong with spell checking. I'll take a look at it and see if I can tell what is up.

LeStarch
LeStarch previously approved these changes Nov 17, 2021
Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@LeStarch LeStarch closed this Nov 17, 2021
@LeStarch LeStarch reopened this Nov 17, 2021
@github-actions
Copy link

github-actions bot commented Nov 17, 2021

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (1)

xls

Previously acknowledged words that are now absent ev fd gz hh IH ip mx pb px py rb td uk ul vh vw wx xl xy
Available dictionaries could cover words not in the dictionary

cspell:cpp/cpp.txt (104293) covers 121 of them
cspell:filetypes/filetypes.txt (337) covers 41 of them
cspell:html/html.txt (542) covers 37 of them
cspell:css/css.txt (993) covers 32 of them
cspell:python/python.txt (364) covers 30 of them
cspell:django/django.txt (2342) covers 22 of them
cspell:aws/aws.txt (1485) covers 18 of them
cspell:golang/go.txt (7745) covers 16 of them
cspell:fullstack/fullstack.txt (181) covers 14 of them
cspell:npm/npm.txt (671) covers 11 of them
cspell:java/java.txt (33524) covers 9 of them
cspell:lua/lua.txt (391) covers 6 of them
cspell:rust/rust.txt (112) covers 5 of them
cspell:csharp/csharp.txt (123) covers 5 of them
cspell:scala/scala.txt (2752) covers 4 of them
cspell:ruby/ruby.txt (354) covers 3 of them
cspell:php/php.txt (9785) covers 3 of them
cspell:dotnet/dotnet.txt (9824) covers 3 of them
cspell:node/node.txt (9611) covers 2 of them
cspell:bash/bash-words.txt (22) covers 1 of them

Consider adding them using:

      with:
        extra_dictionaries:
          cspell:cpp/cpp.txt
          cspell:filetypes/filetypes.txt
          cspell:html/html.txt
          cspell:css/css.txt
          cspell:python/python.txt
          cspell:django/django.txt
          cspell:aws/aws.txt
          cspell:golang/go.txt
          cspell:fullstack/fullstack.txt
          cspell:npm/npm.txt
          cspell:java/java.txt
          cspell:lua/lua.txt
          cspell:rust/rust.txt
          cspell:csharp/csharp.txt
          cspell:scala/scala.txt
          cspell:ruby/ruby.txt
          cspell:php/php.txt
          cspell:dotnet/dotnet.txt
          cspell:node/node.txt
          cspell:bash/bash-words.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:saba-ja/fprime-gds.git repository
on the add_serializable_graph branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/fprime-community/fprime-gds/issues/comments/971903439" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u

@lgtm-com
Copy link

lgtm-com bot commented Nov 30, 2021

This pull request introduces 3 alerts when merging 85ed9bf into c567e49 - view on LGTM.com

new alerts:

  • 1 for Unused loop iteration variable
  • 1 for Useless conditional
  • 1 for Unused variable, import, function or class

@LeStarch LeStarch merged commit 6907b9c into nasa:devel Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants