Before I change a firewall on a remote machine, I want to see what a command would actually do.
sudo ufw --dry-run allow 8080/tcp
With --dry-run, ufw builds the rules and prints what it would do, but does not modify the running firewall or the stored rule files. It works in front of other commands too, such as delete. The output is long because ufw prints the whole rule set, so pipe it through less or grep 8080. It will not tell you whether a rule locks you out, so keep a second SSH session open.
Further reading: ufw manual page