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

action: move and inline LogStart() further up #380

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

evelikov
Copy link

@evelikov evelikov commented Nov 2, 2022

Currently each action starts with LogStart(), adding some annoying duplication. In addition we have a LogStart(), whereas there's no end/stop equivalent.

Instead add the on-line log.Print() wihtin the debos action loop, just prior to calling Run(). The same file deals with all the other pretty logging.

NOTE: this conflicts trivially with #377

action.go Show resolved Hide resolved
action.go Show resolved Hide resolved
actions/apt_action.go Show resolved Hide resolved
@obbardc
Copy link
Member

obbardc commented Jul 17, 2023

@evelikov Can you please rebase onto latest main? I tried myself but cannot push to your fork.

@evelikov
Copy link
Author

@evelikov Can you please rebase onto latest main? I tried myself but cannot push to your fork.

Do you have maintainer access? The Allow edits and access to secrets by maintainers is ticked.

Either way - rebase pushed. Tests are failing badly here (even against main), so it'll leave it to Github to check if I haven't broken anything.

@evelikov evelikov requested a review from obbardc July 18, 2023 07:00
@obbardc
Copy link
Member

obbardc commented Jul 18, 2023

@evelikov Can you please rebase onto latest main? I tried myself but cannot push to your fork.
Do you have maintainer access? The Allow edits and access to secrets by maintainers is ticked.

Yes - as spoken about many times I am a maintainer of this project ;-)

Either way - rebase pushed. Tests are failing badly here (even against main), so it'll leave it to Github to check if I haven't broken anything.

Thanks - curious to see which tests pass as GitHub says All checks have passed - 23 successful and 2 skipped checks

@evelikov
Copy link
Author

In case you're curious here's the go test log

go test -v ./... output

Note: (sub)modules have been fetched already

?   	github.com/go-debos/debos/cmd/debos	[no test files]
=== RUN   TestBasicCommand
2023/07/18 13:27:15 out | total 10808
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users     2670 Jul 18 07:50 action.go
2023/07/18 13:27:15 out | drwxr-xr-x 2 emil users     4096 Jul 18 07:51 actions
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users     5443 Jul 18 07:50 archiver.go
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users     4387 Jul 18 07:50 archiver_test.go
2023/07/18 13:27:15 out | drwxr-xr-x 3 emil users     4096 Oct 12  2021 cmd
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users     7602 Jul 18 07:50 commands.go
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users      112 May 31  2022 commands_test.go
2023/07/18 13:27:15 out | -rwxr-xr-x 1 emil users 10943168 Jul 18 13:27 debos
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users      567 May 31  2022 debug.go
2023/07/18 13:27:15 out | drwxr-xr-x 4 emil users     4096 Jun 10  2021 doc
2023/07/18 13:27:15 out | drwxr-xr-x 2 emil users     4096 Jul 18 07:50 docker
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users     2231 Jul 18 07:50 filesystem.go
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users      486 Jul 18 07:50 go.mod
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users     3991 Jul 18 07:50 go.sum
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users    11349 Jun 10  2021 LICENSE
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users      951 Jun 10  2021 net.go
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users     1315 Jun 10  2021 os.go
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users     7792 Jul 18 07:50 README.md
2023/07/18 13:27:15 out | drwxr-xr-x 8 emil users     4096 Jul 18 07:50 tests
2023/07/18 13:27:15 out | -rw-r--r-- 1 emil users     1619 Jun 10  2021 TODO
--- PASS: TestBasicCommand (0.01s)
=== RUN   TestBase
--- PASS: TestBase (0.00s)
=== RUN   TestTar_default
2023/07/18 13:27:15 unpack | tar: test.tar.gz: Cannot open: No such file or directory
2023/07/18 13:27:15 unpack | tar: Error is not recoverable: exiting now
2023/07/18 13:27:15 unpack | tar: test.tar.gz: Cannot open: No such file or directory
2023/07/18 13:27:15 unpack | tar: Error is not recoverable: exiting now
2023/07/18 13:27:15 unpack | tar: unrecognized option '--option1'
2023/07/18 13:27:15 unpack | Try 'tar --help' or 'tar --usage' for more information.
2023/07/18 13:27:15 unpack | tar: unrecognized option '--option1'
2023/07/18 13:27:15 unpack | Try 'tar --help' or 'tar --usage' for more information.
--- PASS: TestTar_default (0.01s)
=== RUN   TestTar_compression
2023/07/18 13:27:15 unpack | tar (child): test.tar.gz: Cannot open: No such file or directory
2023/07/18 13:27:15 unpack | tar (child): Error is not recoverable: exiting now
2023/07/18 13:27:15 unpack | tar: Child returned status 2
2023/07/18 13:27:15 unpack | tar: Error is not recoverable: exiting now
2023/07/18 13:27:15 unpack | tar (child): test.tar.gz: Cannot open: No such file or directory
2023/07/18 13:27:15 unpack | tar (child): Error is not recoverable: exiting now
2023/07/18 13:27:15 unpack | tar: Child returned status 2
2023/07/18 13:27:15 unpack | tar: Error is not recoverable: exiting now
2023/07/18 13:27:15 unpack | tar (child): test.tar.gz: Cannot open: No such file or directory
2023/07/18 13:27:15 unpack | tar (child): Error is not recoverable: exiting now
2023/07/18 13:27:15 unpack | tar: Child returned status 2
2023/07/18 13:27:15 unpack | tar: Error is not recoverable: exiting now
--- PASS: TestTar_compression (0.01s)
=== RUN   TestDeb
    archiver_test.go:125: 
        	Error Trace:	/home/emil/development/go-debos/debos/archiver_test.go:125
        	Error:      	Error message not equal:
        	            	expected: "exit status 2"
        	            	actual  : "exec: \"dpkg\": executable file not found in $PATH"
        	Test:       	TestDeb
    archiver_test.go:129: 
        	Error Trace:	/home/emil/development/go-debos/debos/archiver_test.go:129
        	Error:      	Error message not equal:
        	            	expected: "exit status 2"
        	            	actual  : "exec: \"dpkg\": executable file not found in $PATH"
        	Test:       	TestDeb
--- FAIL: TestDeb (0.00s)
=== RUN   TestZip
2023/07/18 13:27:15 unpack | unzip:  cannot find or open test.zip, test.zip.zip or test.zip.ZIP.
2023/07/18 13:27:15 unpack | unzip:  cannot find or open test.zip, test.zip.zip or test.zip.ZIP.
--- PASS: TestZip (0.00s)
FAIL
FAIL	github.com/go-debos/debos	0.034s
=== RUN   TestParse_incorrect_file
--- PASS: TestParse_incorrect_file (0.00s)
=== RUN   TestParse_syntax
--- PASS: TestParse_syntax (0.00s)
=== RUN   TestParse_template
--- PASS: TestParse_template (0.00s)
=== RUN   TestParse_sector
--- PASS: TestParse_sector (0.00s)
=== RUN   TestSubRecipe
--- PASS: TestSubRecipe (0.00s)
PASS
ok  	github.com/go-debos/debos/actions	(cached)
FAIL

@obbardc
Copy link
Member

obbardc commented Jul 18, 2023

In case you're curious here's the go test log

Right, seems like you're just missing dpkg locally and one test is failing. I was confused at this originally, it seems like the tests fail as there is error output but that's just misleading.
PS: I'd be willing to skip that test if that file doesn't exist in $path ;-)

@evelikov
Copy link
Author

The MR was approved a week ago, yet didn't land for no obvious reason. Is there anything else I can do to move this forward?

@evelikov
Copy link
Author

evelikov commented Oct 3, 2023

Happy 11 month anniversary :-P Humble poke?

@evelikov
Copy link
Author

evelikov commented Dec 5, 2023

What can I do to get this, or variant thereof, merged?

Maintainers have access to the branch so feel free to rebase/polish as needed.

@obbardc
Copy link
Member

obbardc commented Dec 6, 2023

@evelikov This needs rebasing.

@evelikov
Copy link
Author

evelikov commented Dec 6, 2023

Feel free to give it a try - you have access to the branch.

@obbardc
Copy link
Member

obbardc commented Dec 8, 2023

@evelikov I have rebased your branch and solved the conflicts. I cannot access your fork. Here's the git log:

$ git push evelikov HEAD --force
Enumerating objects: 352, done.
Counting objects: 100% (309/309), done.
Delta compression using up to 16 threads
Compressing objects: 100% (200/200), done.
Writing objects: 100% (252/252), 47.69 KiB | 3.97 MiB/s, done.
Total 252 (delta 134), reused 71 (delta 30), pack-reused 0
remote: Resolving deltas: 100% (134/134), completed with 28 local objects.
To github.com:evelikov/debos.git
 ! [remote rejected] HEAD -> evelikov/remove-logStart (permission denied)
error: failed to push some refs to 'github.com:evelikov/debos.git'

@evelikov
Copy link
Author

evelikov commented Dec 8, 2023

! [remote rejected] HEAD -> evelikov/remove-logStart (permission denied)

This is trying to create a new branch in my repo, instead of updating the existing branch. See https://stackoverflow.com/a/74631110 for step-by-step guide.

@obbardc
Copy link
Member

obbardc commented Dec 8, 2023

FTR, git push -u evelikov HEAD:remove-logStart --force worked.

Currently each action starts with LogStart(), adding some annoying
duplication. In addition we have a LogStart(), whereas there's no
end/stop equivalent.

Instead add the on-line log.Print() wihtin the debos action loop, just
prior to calling Run(). The same file deals with all the other pretty
logging.

v2: Drop pacman/pacstrap hunks

Signed-off-by: Emil Velikov <[email protected]>
@obbardc obbardc added this pull request to the merge queue Dec 8, 2023
Merged via the queue into go-debos:main with commit 7de585a Dec 8, 2023
29 checks passed
@evelikov evelikov deleted the remove-logStart branch December 8, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants