Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
qtomlinson committed Nov 20, 2024
1 parent a83fe72 commit c541259
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions providers/stores/azblobHarvestStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ class AzHarvestBlobStore extends AbstractAzBlobStore {
// Note that here we are assuming the number of blobs will be small-ish (<10) and
// a) all fit in memory reasonably, and
// b) fit in one list call (i.e., <5000)
const files = await this._getAllFiles(coordinates)
return await this._getContent(files)
const allFilesList = await this._getListOfAllFiles(coordinates)
return await this._getContent(allFilesList)
}

_getAllFiles(coordinates) {
_getListOfAllFiles(coordinates) {
const name = this._toStoragePathFromCoordinates(coordinates)
return new Promise((resolve, reject) =>
this.blobService.listBlobsSegmentedWithPrefix(this.containerName, name, null, resultOrError(resolve, reject))
Expand Down Expand Up @@ -100,12 +100,12 @@ class AzHarvestBlobStore extends AbstractAzBlobStore {
*
*/
async getAllLatest(coordinates) {
const allFiles = await this._getAllFiles(coordinates)
const latestFiles = this._getLatestFiles(allFiles)
return await this._getContent(latestFiles)
const allFilesList = await this._getListOfAllFiles(coordinates)
const latestFilesList = this._getListOfLatestFiles(allFilesList)
return await this._getContent(latestFilesList)
}

_getLatestFiles(allFiles) {
_getListOfLatestFiles(allFiles) {
let latestFiles = []
const names = allFiles.map(file => file.name)
try {
Expand Down
14 changes: 7 additions & 7 deletions providers/stores/fileHarvestStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ class FileHarvestStore extends AbstractFileStore {
// Note that here we are assuming the number of blobs will be small-ish (<10) and
// a) all fit in memory reasonably, and
// b) fit in one list call (i.e., <5000)
const files = await this._getAllFiles(coordinates)
return await this._getContent(files)
const allFilesList = await this._getListOfAllFiles(coordinates)
return await this._getContent(allFilesList)
}

async _getAllFiles(coordinates) {
async _getListOfAllFiles(coordinates) {
const root = this._toStoragePathFromCoordinates(coordinates)
try {
return await recursive(root, ['.DS_Store'])
Expand Down Expand Up @@ -90,12 +90,12 @@ class FileHarvestStore extends AbstractFileStore {
*
*/
async getAllLatest(coordinates) {
const allFiles = await this._getAllFiles(coordinates)
const latestFiles = this._getLatestFiles(allFiles)
return await this._getContent(latestFiles)
const allFilesList = await this._getListOfAllFiles(coordinates)
const latestFilesList = this._getListOfLatestFiles(allFilesList)
return await this._getContent(latestFilesList)
}

_getLatestFiles(allFiles) {
_getListOfLatestFiles(allFiles) {
let latestFiles = []
try {
const latest = this._getLatestToolVersions(allFiles)
Expand Down
4 changes: 2 additions & 2 deletions test/providers/store/fileHarvest.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe('getAll and getAllLatest', () => {
})

it('should get latest files', () => {
const result = fileStore._getLatestFiles(allFiles)
const result = fileStore._getListOfLatestFiles(allFiles)
expect(result.length).to.eq(4)
expect(Array.from(result)).to.equalInAnyOrder([
'/tmp/harvested_data/pypi/pypi/-/platformdirs/revision/4.2.0/tool/clearlydefined/1.4.1.json',
Expand All @@ -144,7 +144,7 @@ describe('getAll and getAllLatest', () => {
it('should handle error', () => {
fileStore._getLatestToolVersions = sinon.stub().throws(new Error('test error'))
fileStore.logger.error = sinon.stub()
const result = fileStore._getLatestFiles(allFiles)
const result = fileStore._getListOfLatestFiles(allFiles)
expect(fileStore.logger.error.calledOnce).to.be.true
expect(result.length).to.eq(allFiles.length)
expect(Array.from(result)).to.equalInAnyOrder(allFiles)
Expand Down

0 comments on commit c541259

Please sign in to comment.