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

Rework hooks to allow for easier integration with ROCK #5

Merged
merged 4 commits into from
Feb 24, 2023

Conversation

jardon
Copy link
Contributor

@jardon jardon commented Feb 22, 2023

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Bug Fix

  • What is the current behavior? (You can also link to an open issue here)
    The configure hook handled all setup of the snap

  • What is the new behavior (if this is a feature change)?
    Most of the configuration of the snap is done on an install hook and the configuration hook only handles the snap set features.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    No.

  • Other information:
    N/A

@jardon jardon marked this pull request as ready for review February 22, 2023 20:47
Copy link
Contributor

@MiaAltieri MiaAltieri left a comment

Choose a reason for hiding this comment

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

This looks good. But can you post the set of instructions you used to manually test your changes? 🙏

@jardon jardon requested a review from MiaAltieri February 23, 2023 20:27
Copy link
Contributor

@MiaAltieri MiaAltieri left a comment

Choose a reason for hiding this comment

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

looks good to me

snap/hooks/install Show resolved Hide resolved
Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

LGTM, 2 questions mainly JFMI.

@@ -0,0 +1,31 @@
#!/bin/bash

set -eux
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need trace (x) by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not required, but it is helpful if there was an error. If the install hook fails, the install fails, otherwise, the output is discarded.

Comment on lines +29 to +30
chown -R 584788:root ${SNAP_DATA}/*
chown -R 584788:root ${SNAP_COMMON}/*
Copy link
Contributor

Choose a reason for hiding this comment

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

JFMI only, why we hardcode magic number 584788 instead of snap_daemon?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's for giving flexibility in the rock by not specifying the exact username. This allows us to use the mongo user in the script by setting the user id manually for both accounts.

@jardon jardon merged commit 0c6576e into canonical:5.0/edge Feb 24, 2023
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.

3 participants