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

Use sha1 updateinfo checksumming on EL5 #42

Closed
wants to merge 450 commits into from
Closed

Conversation

lmacken
Copy link
Contributor

@lmacken lmacken commented Mar 25, 2014

ralphbean and others added 30 commits July 26, 2012 10:56
Add mail headers prefixed with "X-Bodhi" to allow easier filtering of
Bodhi's notification emails.
Create initial message ID header and reference it in later e-mails in
'References' and 'In-Reply-To' headers.
Mention the age and sort by it in digest mail, fixes ticket:639.
Import exceptions from sqlite3 when the import from sqlite does not
work.  Seems to be needed with Python 2.7 / Fedora 17.
Send e-mail with last manual comment before sending notification on
automatic status changes, fixes ticket:645.
These are recreated every time one runs "python setup.py <command>"
and they generate new diffs/commits every time something (e.g a
dependency) changes.
This aligns the dependencies in the setup.py file to what is listed in
the spec file.

Nose and WebTest are required only for the unit tests though,
so they can be in tests_require.

All of this helps setting up a new virtualenv for Bodhi.
Mathieu Bridon and others added 25 commits March 3, 2014 16:48
These two lines evaluate equivalent conditions:

    elif tg_errors.has_key('captcha'):
        if 'captcha' in tg_errors:

Therefore, having them one after the other is useless: the second one
will always be True if the first one was.

That means we can use only one fo them, reindent the whole block, and
drop the condition which will always be False:

    elif tg_errors.has_key('captcha'):
        if 'captcha' in tg_errors:
            ...

        else:
            # This can never be True
We can never go through that block, because if tg_errors does have a
'author' key, then we'd have been through the previous one, and we
wouldn't have checked whether it had a 'captcha' key.
Many of these could not be fixed, as they appear in SQLObject queries,
where using is instead of == breaks the filtering.
A couple of PEP 8 fixes
This is similar to what is done with other Yum repository metadata.

It is not just about consistency though, it fixes real issues.

For example, at work, we use the Amazon CDN to implement mirroring of
our Yum repositories. All files are cached on the CDN for the default
duration (i think it's 24 hours), except repomd.xml which is never
cached.

This works great for RPMS (they never change once published) and all
the metadata files (their names are prefixed with their hash, and as
such the CDN sees them as different files).

However, we keep running into trouble with updateinfo.xml.gz: the CDN
keeps distributing the old file even though a new one was generated.

Because the updateinfo metadata can be quite big, we'd rather prefix
its name with a hash (like other Yum repository metadata), and let the
CDN handle it, rather than telling the CDN to never cache it, which
would put more load on our primary repository server.
All other Yum repository metadata are already using this stronger hash,
so let's be consistent and more secure.
If someone tries to uncomment these for debugging purpose, they might
not realize that they don't reflect reality any more, and might waste
lots of time trying to figure out what is going on.
Now that we prefix the file name with its hash, each written file will
have a different name.

As a result, we need to remove the previous versions when we load it,
otherwise we end up accumulating updateinfo.xml.gz metadata files.
The RPM API does not seem to always return a list for the changelog
timestamp(s).

Bodhi has some code trying to identify that and treat it accordingly.

However, it was based on the identified cases where this happened (there
is only one changelog text) instead of just being based on whether or
not the changelog was a list.

It seems that this behaviour in the RPM Python API, as I'm now seeing
cases where Bodhi thinks the timestamp is not in a list, when it
actually is.

This commit fixes this.
Now that we prefix the updateinfo metadata with its hash, the Bodhi
masher must be taught to find it.

The bonus point of using a glob is that it even handles migration from
non-prefixed to prefixed file name. :)
This assertion was failing due to a syntax error in my masher/updateinfo
code.

Adding this message allowed me to find it quickly, and it could be
useful in the future.
Prefix the updateinfo file with its hash
Disable karma automatism on AutoQA test failures (fixes #36)
…373)

Yum on Python2.4 supports the sha256 checksum type only if python-hashlib is
available, but there is not a hard requirement on it.
@lmacken
Copy link
Contributor Author

lmacken commented Mar 25, 2014

Oops, wrong branches

@lmacken lmacken closed this Mar 25, 2014
@lmacken lmacken deleted the feature/sha1-on-el5 branch March 26, 2014 04:41
@lmacken lmacken restored the feature/sha1-on-el5 branch March 26, 2014 04:51
@bowlofeggs bowlofeggs deleted the feature/sha1-on-el5 branch May 24, 2017 20:32
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.