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

Provide "clean" Makefile target #2395

Closed
conorsch opened this issue Oct 3, 2017 · 5 comments · Fixed by #3532
Closed

Provide "clean" Makefile target #2395

conorsch opened this issue Oct 3, 2017 · 5 comments · Fixed by #3532

Comments

@conorsch
Copy link
Contributor

conorsch commented Oct 3, 2017

Feature request

Description

We should have a make clean action in the repo that removes the following:

  • build/*.deb
  • all .retry files
  • all .pyc files

We should consider also removing:

  • site-specific vars overrides
  • gitignored public keys

but there's always the risk that an Admin will run make clean and lose config information. Perhaps that's overly cautious, though.

About the .pyc files, there's a quirk with running the config tests inside the dev VM versus from the developer workstation, which causes the other environment to fail. Such an error looks like this:

ImportMismatchError: ('conftest', '/vagrant/testinfra/conftest.py', local('/home/user/software/securedrop/securedrop/testinfra/conftest.py'))

and can be resolved by removing all .pyc files, which for testinfra store absolute path info. (Thanks to @dachary for the clear report.)

User Stories

As a SecureDrop maintainer, I want to remove all local customizations to ensure I'm testing only the code we ship, and not a bunch of development-and-testing-related conveniences or cruft.

@ghost
Copy link

ghost commented Oct 3, 2017

So testinfra/test.py could make clean to make sure it is not inadvertently re-using pyc from a vagrant vm ?

@conorsch
Copy link
Contributor Author

conorsch commented Oct 3, 2017

True, we could automate that. I'd prefer asking testinfra not to generate any byte code at all, though.

@ghost
Copy link

ghost commented Oct 3, 2017

testinfra not to generate any byte code at all, though.

Yeah but the problem is the bytecode comes from run other than testinfra like pytest -v tests. Maybe there is a way to say do not use bytecode ?

@conorsch
Copy link
Contributor Author

conorsch commented Oct 3, 2017

Great point. Perhaps --cache-clear is the option we want—would have to test to be certain.

@redshiftzero redshiftzero added this to the Product Backlog milestone Oct 25, 2017
@emkll
Copy link
Contributor

emkll commented Jun 15, 2018

The custom logo should also be removed, as it could overwrite the existing custom logo during an upgrade (see #3528)

conorsch pushed a commit that referenced this issue Jun 15, 2018
Resets the project to a pristine state. Explicitly removes dangling
files from previous VM incarnations, such as "app-source-ths",
"config.py", and "build/*.deb".

Additionally runs `git clean -f -x`, which will purge all gitignored
files from the directory. Anything prod-related, such as a pubkey for
OSSEC email alerts, or the *site-specific vars file* will be removed.

Admins should never run this command, since it will destroy
site-specific info. The project documentation instructs Admins to use
the `securedrop-admin` script, and the `Makefile` is only for
developers. Therefore it seems safe to include a destructive action like
this, given that it is not included in Admin-facing documentation.

Closes #2395.
conorsch pushed a commit that referenced this issue Jun 15, 2018
Resets the project to a pristine state. Explicitly removes dangling
files from previous VM incarnations, such as "app-source-ths",
"config.py", and "build/*.deb".

Additionally runs `git clean -f -x`, which will purge all gitignored
files from the directory. Anything prod-related, such as a pubkey for
OSSEC email alerts, or the *site-specific vars file* will be removed.

Admins should never run this command, since it will destroy
site-specific info. The project documentation instructs Admins to use
the `securedrop-admin` script, and the `Makefile` is only for
developers. Therefore it seems safe to include a destructive action like
this, given that it is not included in Admin-facing documentation.

Closes #2395.
conorsch pushed a commit that referenced this issue Jun 28, 2018
Resets the project to a pristine state. Explicitly removes dangling
files from previous VM incarnations, such as "app-source-ths",
"config.py", and "build/*.deb".

Additionally runs `git clean -f -x`, which will purge all gitignored
files from the directory. Anything prod-related, such as a pubkey for
OSSEC email alerts, or the *site-specific vars file* will be removed.

Admins should never run this command, since it will destroy
site-specific info. The project documentation instructs Admins to use
the `securedrop-admin` script, and the `Makefile` is only for
developers. Therefore it seems safe to include a destructive action like
this, given that it is not included in Admin-facing documentation.

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

Successfully merging a pull request may close this issue.

3 participants