Skip to content

Commit 15c99d8

Browse files
committed
Merge branch '3.0' into fasttrack/3.0
2 parents 056d6fe + 62084ef commit 15c99d8

File tree

244 files changed

+5170
-11752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+5170
-11752
lines changed

.github/workflows/check-files.yml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
name: Check Disallowed Files
5+
6+
on:
7+
push:
8+
branches: [main, 2.0*, 3.0*, fasttrack/*]
9+
pull_request:
10+
branches: [main, 2.0*, 3.0*, fasttrack/*]
11+
12+
jobs:
13+
14+
build:
15+
name: Check Disallowed Files
16+
runs-on: ubuntu-latest
17+
steps:
18+
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
22+
- name: Get base commit for PRs
23+
if: ${{ github.event_name == 'pull_request' }}
24+
run: |
25+
git fetch origin ${{ github.base_ref }}
26+
echo "base_sha=$(git rev-parse origin/${{ github.base_ref }})" >> $GITHUB_ENV
27+
echo "Merging ${{ github.sha }} into ${{ github.base_ref }}"
28+
29+
- name: Get base commit for Pushes
30+
if: ${{ github.event_name == 'push' }}
31+
run: |
32+
git fetch origin ${{ github.event.before }}
33+
echo "base_sha=${{ github.event.before }}" >> $GITHUB_ENV
34+
echo "Merging ${{ github.sha }} into ${{ github.event.before }}"
35+
36+
- name: Get the changed files
37+
run: |
38+
echo "Files changed: '$(git diff-tree --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }})'"
39+
changed_files=$(git diff-tree --diff-filter=AM --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }})
40+
echo "Files to validate: '${changed_files}'"
41+
echo "changed-files<<EOF" >> $GITHUB_ENV
42+
echo "${changed_files}" >> $GITHUB_ENV
43+
echo "EOF" >> $GITHUB_ENV
44+
45+
- name: Check for disallowed file types
46+
run: |
47+
if [[ -z "${{ env.changed-files }}" ]]; then
48+
echo "No files to validate. Exiting."
49+
exit 0
50+
fi
51+
52+
echo "Checking files..."
53+
error_found=0
54+
55+
# Read disallowed extensions from the configuration file
56+
if [[ ! -f ".github/workflows/disallowed-extensions.txt" ]]; then
57+
echo "Configuration file '.github/workflows/disallowed-extensions.txt' not found. Skipping check."
58+
exit 0
59+
fi
60+
61+
# Create array of disallowed extensions
62+
mapfile -t disallowed_extensions < .github/workflows/disallowed-extensions.txt
63+
if [[ $? -ne 0 ]]; then
64+
echo "Error occurred while reading disallowed extensions. Exiting."
65+
exit 1
66+
fi
67+
68+
# Check each changed file
69+
while IFS= read -r file; do
70+
if [[ -z "$file" ]]; then
71+
continue
72+
fi
73+
74+
echo "Checking file: $file"
75+
76+
# Get file extension (convert to lowercase for comparison)
77+
extension=$(echo "${file##*.}" | tr '[:upper:]' '[:lower:]')
78+
filename=$(basename "$file")
79+
80+
# Check if file should be in blob store
81+
should_be_in_blob_store=false
82+
83+
# Check against disallowed extensions
84+
for disallowed_ext in "${disallowed_extensions[@]}"; do
85+
# Remove any whitespace and comments
86+
clean_ext=$(echo "$disallowed_ext" | sed 's/#.*//' | xargs)
87+
if [[ -z "$clean_ext" ]]; then
88+
continue
89+
fi
90+
91+
if [[ "$extension" == "$clean_ext" ]]; then
92+
should_be_in_blob_store=true
93+
break
94+
fi
95+
done
96+
97+
# Additional checks for binary files and large files
98+
if [[ -f "$file" ]]; then
99+
# Check if file is binary (but allow .sh files even if executable)
100+
if [[ "$extension" != "sh" ]] && file "$file" | grep -q "binary\|executable\|archive\|compressed"; then
101+
should_be_in_blob_store=true
102+
fi
103+
104+
# Check file size (files > 1MB should be in blob store)
105+
file_size=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null || echo 0)
106+
if [[ $file_size -gt 1048576 ]]; then # 1MB
107+
should_be_in_blob_store=true
108+
fi
109+
fi
110+
111+
if [[ "$should_be_in_blob_store" == "true" ]]; then
112+
1>&2 echo "**** ERROR ****"
113+
1>&2 echo "File '$file' should be stored in blob store, not in git repository."
114+
1>&2 echo "Reason: Images, Large files, binaries, tarballs, and non-text files slow down git operations"
115+
1>&2 echo "and cannot be efficiently diffed. Please upload to blob store instead."
116+
1>&2 echo "**** ERROR ****"
117+
error_found=1
118+
fi
119+
done <<< "${{ env.changed-files }}"
120+
121+
if [[ $error_found -eq 1 ]]; then
122+
echo ""
123+
echo "=========================================="
124+
echo "FILES THAT SHOULD BE IN BLOB STORE DETECTED"
125+
echo "=========================================="
126+
echo "The following file types should be stored in blob store:"
127+
echo "- Source tarballs (.tar.gz, .tar.xz, .zip, etc.)"
128+
echo "- Binary files (.bin, .exe, .so, .dll, etc.)"
129+
echo "- Images (.gif, .bmp, etc.)"
130+
echo "- Archives (.rar, .7z, .tar, etc.)"
131+
echo "- Large files (> 1MB)"
132+
echo "- Any non-text files that cannot be efficiently diffed"
133+
echo ""
134+
echo "Please upload these files to the blob store and reference them"
135+
echo "in your spec files or configuration instead of checking them into git."
136+
echo "=========================================="
137+
exit 1
138+
fi
139+
140+
echo "All files are appropriate for git storage."
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# File extensions that should be stored in blob store instead of git repository
2+
# Lines starting with # are comments and will be ignored
3+
# Extensions should be lowercase without the leading dot
4+
5+
# Source tarballs and archives
6+
tar
7+
gz
8+
tgz
9+
bz2
10+
xz
11+
zip
12+
rar
13+
7z
14+
tar.gz
15+
tar.xz
16+
tar.bz2
17+
18+
# Binary executables
19+
bin
20+
exe
21+
dll
22+
so
23+
dylib
24+
a
25+
lib
26+
obj
27+
o
28+
29+
# Image files
30+
gif
31+
bmp
32+
tiff
33+
tif
34+
webp
35+
raw
36+
heif
37+
38+
39+
# Audio/Video files
40+
mp3
41+
wav
42+
avi
43+
mp4
44+
mkv
45+
mov
46+
wmv
47+
flv
48+
ogg
49+
m4a
50+
aac
51+
52+
# Package files
53+
rpm
54+
deb
55+
msi
56+
dmg
57+
iso
58+
59+
# Compressed source packages
60+
gem
61+
whl
62+
egg
63+
64+
# Database files
65+
db
66+
sqlite
67+
sqlite3
68+
69+
# Fonts
70+
ttf
71+
otf
72+
woff
73+
woff2
74+
75+
# Other binary formats
76+
jar
77+
war
78+
ear
79+
class

.github/workflows/go-test-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches: [main, dev, 1.0*, 2.0*, 3.0*, fasttrack/*]
1111

1212
env:
13-
EXPECTED_GO_VERSION: "1.21"
13+
EXPECTED_GO_VERSION: "1.23"
1414

1515
jobs:
1616
build:

.pipelines/containerSourceData/scripts/PublishContainers.sh

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,52 @@ function acr_login {
9292
# $1: image name
9393
function oras_attach {
9494
local image_name=$1
95+
local max_retries=3
96+
local retry_count=0
97+
98+
while [ $retry_count -lt $max_retries ]; do
99+
echo "+++ Attempting to attach lifecycle annotation to $image_name (attempt $((retry_count + 1))/$max_retries)"
100+
101+
if oras attach \
102+
--artifact-type "application/vnd.microsoft.artifact.lifecycle" \
103+
--annotation "vnd.microsoft.artifact.lifecycle.end-of-life.date=$END_OF_LIFE_1_YEAR" \
104+
"$image_name"; then
105+
echo "+++ Successfully attached lifecycle annotation to $image_name"
106+
return 0
107+
else
108+
retry_count=$((retry_count + 1))
109+
if [ $retry_count -lt $max_retries ]; then
110+
echo "+++ Failed to attach lifecycle annotation to $image_name. Retrying in 5 seconds..."
111+
sleep 5
112+
else
113+
echo "+++ Failed to attach lifecycle annotation to $image_name after $max_retries attempts"
114+
return 1
115+
fi
116+
fi
117+
done
118+
}
119+
120+
# Detach the end-of-life annotation from the container image.
121+
# $1: image name
122+
function oras_detach {
123+
local image_name=$1
124+
lifecycle_manifests=$(oras discover -o json --artifact-type "application/vnd.microsoft.artifact.lifecycle" "$image_name")
125+
manifests=$(echo "$lifecycle_manifests" | jq -r '.manifests')
126+
127+
if [[ -z $manifests ]]; then
128+
echo "+++ No lifecycle manifests found for $image_name"
129+
return
130+
fi
95131

96-
oras attach \
97-
--artifact-type "application/vnd.microsoft.artifact.lifecycle" \
98-
--annotation "vnd.microsoft.artifact.lifecycle.end-of-life.date=$END_OF_LIFE_1_YEAR" \
99-
"$image_name"
132+
echo "+++ Found lifecycle manifests for $image_name: $manifests"
133+
# Loop through the manifests and delete them.
134+
manifest_count=$(echo "$manifests" | jq length)
135+
for (( i=0; i<manifest_count; i++ )); do
136+
digest=$(echo "$lifecycle_manifests" | jq -r ".manifests[$i].digest")
137+
echo "Deleting manifest with digest: $digest"
138+
imageNameWithoutTag=${image_name%:*}
139+
oras manifest delete --force "$imageNameWithoutTag@$digest"
140+
done
100141
}
101142

102143
function create_multi_arch_tags {
@@ -191,6 +232,7 @@ function create_multi_arch_tags {
191232
echo "+++ push $full_multiarch_tag tag"
192233
docker manifest push "$full_multiarch_tag"
193234
echo "+++ $full_multiarch_tag tag pushed successfully"
235+
oras_detach "$full_multiarch_tag"
194236
oras_attach "$full_multiarch_tag"
195237

196238
# Save the multi-arch tag to a file.
@@ -281,6 +323,7 @@ do
281323
docker image tag "$amd64_image" "$amd64_retagged_image_name"
282324
docker rmi "$amd64_image"
283325
docker image push "$amd64_retagged_image_name"
326+
oras_detach "$amd64_retagged_image_name"
284327
oras_attach "$amd64_retagged_image_name"
285328

286329
if [[ $ARCHITECTURE_TO_BUILD == *"ARM64"* ]]; then
@@ -289,6 +332,7 @@ do
289332
docker image tag "$arm64_image" "$arm64_retagged_image_name"
290333
docker rmi "$arm64_image"
291334
docker image push "$arm64_retagged_image_name"
335+
oras_detach "$arm64_retagged_image_name"
292336
oras_attach "$arm64_retagged_image_name"
293337
fi
294338

LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSES-AND-NOTICES/SPECS/data/licenses.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@
20002000
"scotch",
20012001
"screen",
20022002
"scrub",
2003-
"SDL",
2003+
"sdl12-compat",
20042004
"SDL2",
20052005
"SDL_sound",
20062006
"sdparm",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"PyGreSQL-5.2.2.tar.gz": "8c6c56f95cf08337075be0930a1d28333624ebcd6180cf888c59d3e2887f32ce"
3+
"PyGreSQL-6.0.1.tar.gz": "57e44af29c7443641ca65e549e568848946f937597cf19064bbfadc4e5e53bfb"
44
}
55
}

SPECS-EXTENDED/PyGreSQL/PyGreSQL.spec

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
%global with_tests 0
2+
13
Vendor: Microsoft Corporation
24
Distribution: Azure Linux
35
%global srcname PyGreSQL
46

57
Name: %{srcname}
6-
Version: 5.2.2
7-
Release: 3%{?dist}
8+
Version: 6.0.1
9+
Release: 1%{?dist}
810
Summary: Python client library for PostgreSQL
911

1012
URL: http://www.pygresql.org/
1113
License: PostgreSQL
1214

13-
Source0: https://github.com/PyGreSQL/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
15+
Source0: https://github.com/PyGreSQL/%{name}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
1416

1517
BuildRequires: gcc
1618
BuildRequires: libpq-devel
@@ -58,12 +60,18 @@ find -type f -exec chmod 644 {} +
5860
%files -n python3-pygresql
5961
%license docs/copyright.rst
6062
%doc docs/*.rst
61-
%{python3_sitearch}/*.so
62-
%{python3_sitearch}/*.py
63-
%{python3_sitearch}/__pycache__/*.py{c,o}
63+
%{python3_sitearch}/pg/*.so
64+
%{python3_sitearch}/pg/*.py
65+
%{python3_sitearch}//pg/__pycache__/*.py{c,o}
66+
%{python3_sitearch}/pg/_pg.pyi
67+
%{python3_sitearch}/pg/py.typed
68+
%{python3_sitearch}/pgdb/*.py
69+
%{python3_sitearch}/pgdb/__pycache__/*.py{c,o}
70+
%{python3_sitearch}/pgdb/py.typed
6471
%{python3_sitearch}/*.egg-info
6572

66-
73+
# Requires postgresql-test-rpm-macros which is not provided by postgresql in Azure Linux.
74+
%if 0%{?with_tests}
6775
%check
6876
%postgresql_tests_run
6977

@@ -76,9 +84,12 @@ dbport = $PGPORT
7684
EOF
7785

7886
%{__python3} setup.py test
79-
87+
%endif
8088

8189
%changelog
90+
* Wed Sep 25 2024 jyoti kanase <[email protected]> - 6.0.1-1
91+
- Update to 6.0.1
92+
8293
* Thu Aug 31 2023 Pawel Winogrodzki <[email protected]> - 5.2.2-3
8394
- Disabling missing test dependency.
8495
- License verified.

0 commit comments

Comments
 (0)